Class ConfBuilder
- java.lang.Object
-
- io.streamthoughts.azkarra.api.config.ConfBuilder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Confbuild()booleangetBoolean(String path)Gets a required parameter as an boolean.<T> TgetClass(String path, Class<T> type)Gets a required parameter as an instances of typeConf.<T> Collection<T>getClasses(String path, Class<T> type)Gets a required parameter as a list of instances of typeConf.Map<String,Object>getConfAsMap()Converts thisConfinto a path-value map.PropertiesgetConfAsProperties()Converts thisConfinto a properties.doublegetDouble(String path)Gets a required parameter as a double.intgetInt(String path)Gets a required parameter as an integer.longgetLong(String path)Gets a required parameter as a long.StringgetString(String path)Gets a required parameter a a string.List<String>getStringList(String path)Gets a required parameter as a list.ConfgetSubConf(String path)Gets a required parameter as aConf.List<Conf>getSubConfList(String path)Gets a required parameter as a list ofConf.booleanhasPath(String path)Checks whether the specified path exists into thisConf.static ConfBuildernewConf()static ConfBuildernewConf(Conf conf)StringtoString()ConfBuilderwith(String key, Object value)ConfwithFallback(Conf fallback)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.streamthoughts.azkarra.api.config.Conf
getOptionalBoolean, getOptionalDouble, getOptionalInt, getOptionalLong, getOptionalString
-
-
-
-
Method Detail
-
newConf
public static ConfBuilder newConf(Conf conf)
-
newConf
public static ConfBuilder newConf()
-
with
public ConfBuilder with(String key, Object value)
-
getLong
public long getLong(String path)
Gets a required parameter as a long.
-
getInt
public int getInt(String path)
Gets a required parameter as an integer.
-
getBoolean
public boolean getBoolean(String path)
Gets a required parameter as an boolean.- Specified by:
getBooleanin interfaceConf- Parameters:
path- the parameter path.- Returns:
- the parameter value as a boolean.
-
getDouble
public double getDouble(String path)
Gets a required parameter as a double.
-
getStringList
public List<String> getStringList(String path)
Description copied from interface:ConfGets a required parameter as a list.- Specified by:
getStringListin interfaceConf- Parameters:
path- the parameter path.- Returns:
- a string list value.
-
getSubConf
public Conf getSubConf(String path)
Gets a required parameter as aConf.- Specified by:
getSubConfin interfaceConf- Parameters:
path- the parameter path.- Returns:
- a new
Confinstance.
-
getSubConfList
public List<Conf> getSubConfList(String path)
Gets a required parameter as a list ofConf.- Specified by:
getSubConfListin interfaceConf- Parameters:
path- the parameter path.- Returns:
- a new list of
Confinstances.
-
hasPath
public boolean hasPath(String path)
Checks whether the specified path exists into thisConf.
-
withFallback
public Conf withFallback(Conf fallback)
- Specified by:
withFallbackin interfaceConf
-
getClasses
public <T> Collection<T> getClasses(String path, Class<T> type)
Gets a required parameter as a list of instances of typeConf.- Specified by:
getClassesin interfaceConf- Type Parameters:
T- the expected type.- Parameters:
path- the parameter path.type- the class of the .- Returns:
- a new
CollectionofConf.
-
getClass
public <T> T getClass(String path, Class<T> type)
Gets a required parameter as an instances of typeConf.- Specified by:
getClassin interfaceConf- Type Parameters:
T- the expected type.- Parameters:
path- the parameter path.type- the class of the .- Returns:
- a new
CollectionofConf.
-
getConfAsMap
public Map<String,Object> getConfAsMap()
Converts thisConfinto a path-value map.- Specified by:
getConfAsMapin interfaceConf- Returns:
- a new
Mapinstance containing the configuration values.
-
getConfAsProperties
public Properties getConfAsProperties()
Converts thisConfinto a properties.- Specified by:
getConfAsPropertiesin interfaceConf- Returns:
- a new
Propertiesinstance containing the configuration values.
-
build
public Conf build()
-
-