Package com.suse.common.configuration
Interface ConfigurationSource
- All Known Implementing Classes:
BaseConfigurationSource,EnvironmentConfigurationSource,FileConfigurationSource,MultipleConfigurationSource,ResourceConfigurationSource
public interface ConfigurationSource
-
Method Summary
Modifier and TypeMethodDescriptiongetBoolean(String property) Retrieve the boolean value of a property.Retrieve the double value of a property.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.default BooleanrequireBoolean(String property) Retrieve the boolean value of a required property.default DoublerequireDouble(String property) Retrieve the double value of a required property.default FloatrequireFloat(String property) Retrieve the float value of a required property.default IntegerrequireInteger(String property) Retrieve the integer value of a required property.default <T> List<T>requireList(String property, Class<T> itemClass) Retrieve the list value of a required property.default LongrequireLong(String property) Retrieve the long value of a required property.default StringrequireString(String property) Retrieve the string value of a required property.Converts this configuration source to aPropertiesobject.
-
Method Details
-
getBoolean
Retrieve the boolean value of a property.- Parameters:
property- the property name- Returns:
- the boolean wrapped into an
Optional
-
requireBoolean
Retrieve the boolean value of a required property.- Parameters:
property- the property name- Returns:
- the boolean value
- Throws:
MissingConfigurationException- if the property is not available in this source
-
getString
Retrieve the string value of a property.- Parameters:
property- the property name- Returns:
- the string wrapped into an
Optional
-
requireString
Retrieve the string value of a required property.- Parameters:
property- the property name- Returns:
- the string value
- Throws:
MissingConfigurationException- if the property is not available in this source
-
getInteger
Retrieve the integer value of a property.- Parameters:
property- the property name- Returns:
- the integer wrapped into an
Optional
-
requireInteger
Retrieve the integer value of a required property.- Parameters:
property- the property name- Returns:
- the integer value
- Throws:
MissingConfigurationException- if the property is not available in this source
-
getLong
Retrieve the long value of a property.- Parameters:
property- the property name- Returns:
- the long wrapped into an
Optional
-
requireLong
Retrieve the long value of a required property.- Parameters:
property- the property name- Returns:
- the long value
- Throws:
MissingConfigurationException- if the property is not available in this source
-
getFloat
Retrieve the float value of a property.- Parameters:
property- the property name- Returns:
- the float wrapped into an
Optional
-
requireFloat
Retrieve the float value of a required property.- Parameters:
property- the property name- Returns:
- the float value
- Throws:
MissingConfigurationException- if the property is not available in this source
-
getDouble
Retrieve the double value of a property.- Parameters:
property- the property name- Returns:
- the double wrapped into an
Optional
-
requireDouble
Retrieve the double value of a required property.- Parameters:
property- the property name- Returns:
- the double value
- Throws:
MissingConfigurationException- if the property is not available in this source
-
getList
Retrieve the list value of a property.- 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
-
requireList
Retrieve the list value of a required property.- 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 value
- Throws:
MissingConfigurationException- if the property is not available in this source
-
getPropertyNames
Retrieves the names of all the available properties.- Returns:
- the set of property names
-
toProperties
Properties toProperties()Converts this configuration source to aPropertiesobject.- Returns:
- all the properties value stored into
Propertiesobject
-