Class SimplePropertySource
java.lang.Object
io.fluxzero.common.application.SimplePropertySource
- All Implemented Interfaces:
PropertySource
A simple in-memory implementation of the
PropertySource interface backed by a Map.
This class is typically used for programmatic configuration, testing, or cases where property values are supplied dynamically at runtime from an explicit key-value source.
Example usage:
Map<String, String> props = Map.of("api.key", "12345", "timeout", "1000");
PropertySource propertySource = new SimplePropertySource(props);
String apiKey = propertySource.get("api.key");
- See Also:
-
Field Summary
Fields inherited from interface PropertySource
substitutionPattern -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PropertySource
andThen, containsProperty, get, getBoolean, getBoolean, require, substituteProperties, substituteProperties
-
Constructor Details
-
SimplePropertySource
public SimplePropertySource()
-
-
Method Details
-
get
Retrieves the value associated with the given property name from the internal map.- Specified by:
getin interfacePropertySource- Parameters:
name- the name of the property to retrieve- Returns:
- the corresponding property value, or
nullif not present
-