Class JavaPropertiesSource
java.lang.Object
io.fluxcapacitor.common.application.JavaPropertiesSource
- All Implemented Interfaces:
PropertySource
- Direct Known Subclasses:
ApplicationEnvironmentPropertiesSource
,ApplicationPropertiesSource
,SystemPropertiesSource
Base class for
PropertySource
implementations backed by a Properties
object.
This class provides a thin wrapper over a Properties
instance and offers a consistent
way to retrieve configuration values using the get(String)
method.
It can be extended by concrete sources such as SystemPropertiesSource
or custom property file loaders.
- See Also:
-
Field Summary
Fields inherited from interface io.fluxcapacitor.common.application.PropertySource
substitutionPattern
-
Constructor Summary
ConstructorsConstructorDescriptionJavaPropertiesSource
(Properties properties) Creates a new property source backed by the givenProperties
instance. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.common.application.PropertySource
andThen, containsProperty, get, getBoolean, getBoolean, require, substituteProperties
-
Constructor Details
-
JavaPropertiesSource
Creates a new property source backed by the givenProperties
instance.- Parameters:
properties
- theProperties
instance to use for lookups
-
-
Method Details
-
get
Retrieves the value for the given property name.- Specified by:
get
in interfacePropertySource
- Parameters:
name
- the property key- Returns:
- the property value, or
null
if not present
-