Module org.github.gestalt.core
Class SourceBuilder<SELF extends SourceBuilder<SELF,T>,T extends ConfigSource>
- java.lang.Object
-
- org.github.gestalt.config.builder.SourceBuilder<SELF,T>
-
- Direct Known Subclasses:
ClassPathConfigSourceBuilder,EnvironmentConfigSourceBuilder,FileConfigSourceBuilder,KubernetesSecretConfigSourceBuilder,MapConfigSourceBuilder,StringConfigSourceBuilder,SystemPropertiesConfigSourceBuilder,URLConfigSourceBuilder
public abstract class SourceBuilder<SELF extends SourceBuilder<SELF,T>,T extends ConfigSource> extends java.lang.ObjectBase class for all source builders.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<ConfigReloadStrategy>configReloadStrategiesprotected ConfigSourcesourceprotected Tagstags
-
Constructor Summary
Constructors Constructor Description SourceBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description SELFaddConfigReloadStrategy(ConfigReloadStrategy configReloadStrategy)Add a ConfigReloadStrategyBuilder to the builder.SELFaddTag(Tag tag)Add a tag to the builder.abstract ConfigSourcePackagebuild()Build the ConfigSourcePackage with the config source, tags and any reload strategies.protected ConfigSourcePackagebuildPackage(ConfigSource source)java.util.List<ConfigReloadStrategy>getConfigReloadStrategies()Get the list of ConfigReloadStrategyBuilder for the builder.TagsgetTags()Get the tags for the builder.protected SELFself()SELFsetTags(Tags tags)Set the tags for the builder.
-
-
-
Field Detail
-
configReloadStrategies
protected final java.util.List<ConfigReloadStrategy> configReloadStrategies
-
source
protected ConfigSource source
-
tags
protected Tags tags
-
-
Method Detail
-
getTags
public Tags getTags()
Get the tags for the builder.- Returns:
- the tags for the builder
-
setTags
public SELF setTags(Tags tags)
Set the tags for the builder.- Parameters:
tags- the tags for the builder.- Returns:
- the builder
-
addTag
public SELF addTag(Tag tag)
Add a tag to the builder.- Parameters:
tag- tag to add to the builder- Returns:
- the builder
-
getConfigReloadStrategies
public java.util.List<ConfigReloadStrategy> getConfigReloadStrategies()
Get the list of ConfigReloadStrategyBuilder for the builder.- Returns:
- list of ConfigReloadStrategyBuilder for the builder.
-
addConfigReloadStrategy
public SELF addConfigReloadStrategy(ConfigReloadStrategy configReloadStrategy)
Add a ConfigReloadStrategyBuilder to the builder.- Parameters:
configReloadStrategy- ConfigReloadStrategyBuilder to add to the builder- Returns:
- the builder
-
build
public abstract ConfigSourcePackage build() throws GestaltException
Build the ConfigSourcePackage with the config source, tags and any reload strategies.- Returns:
- the ConfigSourcePackage with the config source, tags and any reload strategies.
- Throws:
GestaltException- exceptions if any of the required properties are not set.
-
buildPackage
protected ConfigSourcePackage buildPackage(ConfigSource source) throws GestaltException
- Throws:
GestaltException
-
self
protected final SELF self()
-
-