Module org.github.gestalt.core
Package org.github.gestalt.config.source
Class FileConfigSourceBuilder
- java.lang.Object
-
- org.github.gestalt.config.builder.SourceBuilder<FileConfigSourceBuilder,FileConfigSource>
-
- org.github.gestalt.config.source.FileConfigSourceBuilder
-
public final class FileConfigSourceBuilder extends SourceBuilder<FileConfigSourceBuilder,FileConfigSource>
ConfigSourceBuilder for the File Config Source.Load a config source from a local file.
-
-
Field Summary
-
Fields inherited from class org.github.gestalt.config.builder.SourceBuilder
configReloadStrategies, source, tags
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigSourcePackagebuild()Build the ConfigSourcePackage with the config source, tags and any reload strategies.static FileConfigSourceBuilderbuilder()Static function to create the builder.java.io.FilegetFile()Get the file for the config source.java.nio.file.PathgetPath()Get the path for the config source.FileConfigSourceBuildersetFile(java.io.File file)Set the file for the config source.FileConfigSourceBuildersetPath(java.nio.file.Path path)Set the path for the config source.-
Methods inherited from class org.github.gestalt.config.builder.SourceBuilder
addConfigReloadStrategy, addTag, buildPackage, getConfigReloadStrategies, getTags, self, setTags
-
-
-
-
Method Detail
-
builder
public static FileConfigSourceBuilder builder()
Static function to create the builder.- Returns:
- the builder
-
getPath
public java.nio.file.Path getPath()
Get the path for the config source.- Returns:
- the path for the config source
-
setPath
public FileConfigSourceBuilder setPath(java.nio.file.Path path)
Set the path for the config source.- Parameters:
path- the path for the config source- Returns:
- the builder
-
getFile
public java.io.File getFile()
Get the file for the config source.- Returns:
- the file for the config source.
-
setFile
public FileConfigSourceBuilder setFile(java.io.File file)
Set the file for the config source.- Parameters:
file- Set the file for the config source.- Returns:
- the builder
-
build
public ConfigSourcePackage build() throws GestaltException
Description copied from class:SourceBuilderBuild the ConfigSourcePackage with the config source, tags and any reload strategies.- Specified by:
buildin classSourceBuilder<FileConfigSourceBuilder,FileConfigSource>- Returns:
- the ConfigSourcePackage with the config source, tags and any reload strategies.
- Throws:
GestaltException- exceptions if any of the required properties are not set.
-
-