Module org.github.gestalt.core
Package org.github.gestalt.config.source
Class ClassPathConfigSourceBuilder
- java.lang.Object
-
- org.github.gestalt.config.builder.SourceBuilder<ClassPathConfigSourceBuilder,ClassPathConfigSource>
-
- org.github.gestalt.config.source.ClassPathConfigSourceBuilder
-
public final class ClassPathConfigSourceBuilder extends SourceBuilder<ClassPathConfigSourceBuilder,ClassPathConfigSource>
ConfigSourceBuilder for the Class Path Config Source.Load a config source from a classpath resource using the getResourceAsStream method.
-
-
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 ClassPathConfigSourceBuilderbuilder()Static function to create the builder.java.lang.StringgetResource()Get the resource path as a string.ClassPathConfigSourceBuildersetResource(java.lang.String resource)Set the resource path as a string.-
Methods inherited from class org.github.gestalt.config.builder.SourceBuilder
addConfigReloadStrategy, addTag, buildPackage, getConfigReloadStrategies, getTags, self, setTags
-
-
-
-
Method Detail
-
builder
public static ClassPathConfigSourceBuilder builder()
Static function to create the builder.- Returns:
- the builder
-
getResource
public java.lang.String getResource()
Get the resource path as a string.- Returns:
- the resource path as a string
-
setResource
public ClassPathConfigSourceBuilder setResource(java.lang.String resource)
Set the resource path as a string.- Parameters:
resource- the resource path as a string.- 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<ClassPathConfigSourceBuilder,ClassPathConfigSource>- Returns:
- the ConfigSourcePackage with the config source, tags and any reload strategies.
- Throws:
GestaltException- exceptions if any of the required properties are not set.
-
-