public class ConfigEntry<T>
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
ConfigEntry<T> |
createWithDefault(T t)
Creates a new ConfigEntry instance based on this configuration entry with a default value.
|
ConfigEntry<java.util.Optional<T>> |
createWithOptional()
Creates a new ConfigEntry instance based on this configuration entry with optional value
handling.
|
T |
readFrom(java.util.Map<java.lang.String,java.lang.String> properties)
Reads the configuration value.
|
void |
writeTo(java.util.Map<java.lang.String,java.lang.String> properties,
T value)
Writes the provided value to the specified properties map.
|
public ConfigEntry<T> createWithDefault(T t)
t
- The default value to be used when no value is provided.public ConfigEntry<java.util.Optional<T>> createWithOptional()
public T readFrom(java.util.Map<java.lang.String,java.lang.String> properties) throws java.util.NoSuchElementException
properties
- The map containing the configuration properties.java.util.NoSuchElementException
- If the configuration value is not found.public void writeTo(java.util.Map<java.lang.String,java.lang.String> properties, T value)
properties
- The map to write the configuration property to.value
- The value of the configuration entry.