Class MapConf
- java.lang.Object
-
- io.streamthoughts.azkarra.api.config.AbstractConf
-
- io.streamthoughts.azkarra.api.config.MapConf
-
- All Implemented Interfaces:
Conf
public class MapConf extends AbstractConf
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,?>
parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getBoolean(String path)
Gets a required parameter as an boolean.Map<String,Object>
getConfAsMap()
Converts thisConf
into a path-value map.Properties
getConfAsProperties()
Converts thisConf
into a properties.double
getDouble(String path)
Gets a required parameter as a double.int
getInt(String path)
Gets a required parameter as an integer.long
getLong(String path)
Gets a required parameter as a long.String
getString(String path)
Gets a required parameter a a string.List<String>
getStringList(String path)
Gets a required parameter as a list.Conf
getSubConf(String path)
Gets a required parameter as aConf
.List<Conf>
getSubConfList(String path)
Gets a required parameter as a list ofConf
.boolean
hasPath(String path)
Checks whether the specified path exists into thisConf
.String
toString()
Conf
withFallback(Conf fallback)
-
Methods inherited from class io.streamthoughts.azkarra.api.config.AbstractConf
getClass, getClasses
-
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
-
getString
public String getString(String path)
Gets a required parameter a a string.- Parameters:
path
- the parameter path.- Returns:
- the parameter value as a string.
-
getLong
public long getLong(String path)
Gets a required parameter as a long.- Parameters:
path
- the parameter path.- Returns:
- the parameter value as a long.
-
getInt
public int getInt(String path)
Gets a required parameter as an integer.- Parameters:
path
- the parameter path.- Returns:
- the parameter value as a int.
-
getBoolean
public boolean getBoolean(String path)
Gets a required parameter as an boolean.- 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.- Parameters:
path
- the parameter path.- Returns:
- the parameter value as a double.
-
getStringList
public List<String> getStringList(String path)
Gets a required parameter as a list.- Parameters:
path
- the parameter path.- Returns:
- a string list value.
-
getSubConf
public Conf getSubConf(String path)
Gets a required parameter as aConf
.- Parameters:
path
- the parameter path.- Returns:
- a new
Conf
instance.
-
getSubConfList
public List<Conf> getSubConfList(String path)
Gets a required parameter as a list ofConf
.- Parameters:
path
- the parameter path.- Returns:
- a new list of
Conf
instances.
-
hasPath
public boolean hasPath(String path)
Checks whether the specified path exists into thisConf
.- Parameters:
path
- the path to be checked.- Returns:
true
if the path exists,false
otherwise.
-
getConfAsMap
public Map<String,Object> getConfAsMap()
Converts thisConf
into a path-value map.- Returns:
- a new
Map
instance containing the configuration values.
-
getConfAsProperties
public Properties getConfAsProperties()
Converts thisConf
into a properties.- Returns:
- a new
Properties
instance containing the configuration values.
-
-