Package com.suse.common.configuration
Class MultipleConfigurationSource
java.lang.Object
com.suse.common.configuration.MultipleConfigurationSource
- All Implemented Interfaces:
ConfigurationSource
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMultipleConfigurationSource(List<ConfigurationSource> configurationSourcesIn) Build a combined configuration source from the combination of all the ones specified in the list. -
Method Summary
Modifier and TypeMethodDescriptiongetBoolean(String property) Retrieve the boolean value of a property.Retrieve the double value of a property.private <T> Optional<T>getFirstValue(String property, BiFunction<ConfigurationSource, String, Optional<T>> propertyRetriever) Retrieve the float value of a property.getInteger(String property) Retrieve the integer value of a property.Retrieve the list value of a property.Retrieve the long value of a property.Retrieves the names of all the available properties.Retrieve the string value of a property.Converts this configuration source to aPropertiesobject.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.suse.common.configuration.ConfigurationSource
requireBoolean, requireDouble, requireFloat, requireInteger, requireList, requireLong, requireString
-
Field Details
-
configurationSources
-
-
Constructor Details
-
MultipleConfigurationSource
Build a combined configuration source from the combination of all the ones specified in the list.- Parameters:
configurationSourcesIn- the list of sources. The order of the sources will be respected when retrieving the properties.
-
-
Method Details
-
getBoolean
Description copied from interface:ConfigurationSourceRetrieve the boolean value of a property.- Specified by:
getBooleanin interfaceConfigurationSource- Parameters:
property- the property name- Returns:
- the boolean wrapped into an
Optional
-
getString
Description copied from interface:ConfigurationSourceRetrieve the string value of a property.- Specified by:
getStringin interfaceConfigurationSource- Parameters:
property- the property name- Returns:
- the string wrapped into an
Optional
-
getInteger
Description copied from interface:ConfigurationSourceRetrieve the integer value of a property.- Specified by:
getIntegerin interfaceConfigurationSource- Parameters:
property- the property name- Returns:
- the integer wrapped into an
Optional
-
getLong
Description copied from interface:ConfigurationSourceRetrieve the long value of a property.- Specified by:
getLongin interfaceConfigurationSource- Parameters:
property- the property name- Returns:
- the long wrapped into an
Optional
-
getFloat
Description copied from interface:ConfigurationSourceRetrieve the float value of a property.- Specified by:
getFloatin interfaceConfigurationSource- Parameters:
property- the property name- Returns:
- the float wrapped into an
Optional
-
getDouble
Description copied from interface:ConfigurationSourceRetrieve the double value of a property.- Specified by:
getDoublein interfaceConfigurationSource- Parameters:
property- the property name- Returns:
- the double wrapped into an
Optional
-
getList
Description copied from interface:ConfigurationSourceRetrieve the list value of a property.- Specified by:
getListin interfaceConfigurationSource- Type Parameters:
T- the type of item of the list- Parameters:
property- the property nameitemClass- the type of item of the list.- Returns:
- the list wrapped into an
Optional
-
getFirstValue
private <T> Optional<T> getFirstValue(String property, BiFunction<ConfigurationSource, String, Optional<T>> propertyRetriever) -
getPropertyNames
Description copied from interface:ConfigurationSourceRetrieves the names of all the available properties.- Specified by:
getPropertyNamesin interfaceConfigurationSource- Returns:
- the set of property names
-
toProperties
Description copied from interface:ConfigurationSourceConverts this configuration source to aPropertiesobject.- Specified by:
toPropertiesin interfaceConfigurationSource- Returns:
- all the properties value stored into
Propertiesobject
-