java.lang.Object
dev.orne.config.DelegatedConfig
- All Implemented Interfaces:
Config
- Direct Known Subclasses:
DelegatedMutableConfig
A configuration that delegates all operations to another configuration.
This class is useful for creating a proxy or wrapper around an existing
configuration instance, allowing for additional behavior or modifications
without changing the original configuration.
- Since:
- 1.0
- Version:
- 1.0, 2025-08
- Author:
- (w) Iker Hernaez
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the property with the key passed as argument has been configured.Returns the value of the configuration parameter asString.@Nullable StringReturns the value of the configuration parameter asString.@Nullable StringReturns the value of the configuration parameter asString.@Nullable BooleangetBoolean(String key) Returns the value of the configuration parameter asBoolean.booleangetBoolean(String key, boolean defaultValue) Returns the value of the configuration parameter asBoolean.@Nullable BooleangetBoolean(String key, Supplier<@Nullable Boolean> defaultValue) Returns the value of the configuration parameter asBoolean.protected ConfigReturns the delegate configuration.@Nullable IntegergetInteger(String key) Returns the integer value of the specified configuration property, with variable substitution.intgetInteger(String key, int defaultValue) Returns the integer value of the specified configuration property, with variable substitution.@Nullable IntegergetInteger(String key, Supplier<@Nullable Integer> defaultValue) Returns the value of the configuration parameter asBoolean.getKeys()Returns the configuration property keys contained in this configuration.Returns the configuration property keys contained in this configuration that start with the specified prefix.Returns the configuration property keys contained in this configuration that match the specified predicate.@Nullable LongReturns the integer value of the specified configuration property, with variable substitution.longReturns the integer value of the specified configuration property, with variable substitution.@Nullable LongReturns the value of the configuration parameter asBoolean.@Nullable ConfigReturns the parent configuration, if any.@Nullable StringgetUndecored(String key) Returns the value of the configuration parameter asStringwithout applying any decoration or transformation.booleanisEmpty()Returnstrueif the configuration contains no property.
-
Constructor Details
-
DelegatedConfig
Creates a new instance.- Parameters:
delegate- The configuration to delegate to.
-
-
Method Details
-
getDelegate
Returns the delegate configuration.- Returns:
- The delegate configuration.
-
getParent
Returns the parent configuration, if any. -
isEmpty
public boolean isEmpty()Returnstrueif the configuration contains no property. -
contains
Returnstrueif the property with the key passed as argument has been configured. -
getKeys
Returns the configuration property keys contained in this configuration. -
getKeys
Returns the configuration property keys contained in this configuration that match the specified predicate. -
getKeys
Returns the configuration property keys contained in this configuration that start with the specified prefix. -
get
Returns the value of the configuration parameter asString. -
getUndecored
Returns the value of the configuration parameter asStringwithout applying any decoration or transformation.- Specified by:
getUndecoredin interfaceConfig- Parameters:
key- The configuration property- Returns:
- The configuration parameter value as
String
-
get
Returns the value of the configuration parameter asString. -
get
Returns the value of the configuration parameter asString. -
getBoolean
Returns the value of the configuration parameter asBoolean.- Specified by:
getBooleanin interfaceConfig- Parameters:
key- The key of the configuration parameter- Returns:
- The configuration parameter value as
Boolean
-
getBoolean
Returns the value of the configuration parameter asBoolean.- Specified by:
getBooleanin interfaceConfig- Parameters:
key- The key of the configuration parameterdefaultValue- The default value to return if the configuration parameter is not set or isnull.- Returns:
- The configuration parameter value as
Boolean
-
getBoolean
Returns the value of the configuration parameter asBoolean.- Specified by:
getBooleanin interfaceConfig- Parameters:
key- The key of the configuration parameterdefaultValue- The default value supplier if the configuration parameter is not set or isnull.- Returns:
- The configuration parameter value as
Boolean
-
getInteger
Returns the integer value of the specified configuration property, with variable substitution.- Specified by:
getIntegerin interfaceConfig- Parameters:
key- The configuration property.- Returns:
- The value configuration property, if any.
-
getInteger
Returns the integer value of the specified configuration property, with variable substitution.- Specified by:
getIntegerin interfaceConfig- Parameters:
key- The configuration property.defaultValue- The default value to return if the configuration parameter is not set or isnull.- Returns:
- The value configuration property, if any.
-
getInteger
Returns the value of the configuration parameter asBoolean.- Specified by:
getIntegerin interfaceConfig- Parameters:
key- The key of the configuration parameterdefaultValue- The default value supplier if the configuration parameter is not set or isnull.- Returns:
- The configuration parameter value as
Boolean
-
getLong
Returns the integer value of the specified configuration property, with variable substitution. -
getLong
Returns the integer value of the specified configuration property, with variable substitution. -
getLong
Returns the value of the configuration parameter asBoolean.
-