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.Returns the value of the configuration parameter asString.Returns the value of the configuration parameter asString.getBoolean(@NotBlank String key) Returns the value of the configuration parameter asBoolean.booleangetBoolean(@NotBlank String key, boolean defaultValue) Returns the value of the configuration parameter asBoolean.getBoolean(@NotBlank String key, @NotNull Supplier<Boolean> defaultValue) Returns the value of the configuration parameter asBoolean.protected @NotNull ConfigReturns the delegate configuration.getInteger(@NotBlank String key, @NotNull Supplier<Integer> defaultValue) Returns the value of the configuration parameter asBoolean.getInteger(@NotNull String key) Returns the integer value of the specified configuration property, with variable substitution.intgetInteger(@NotNull String key, int defaultValue) Returns the integer value of the specified configuration property, with variable substitution.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.Returns the value of the configuration parameter asBoolean.Returns the integer value of the specified configuration property, with variable substitution.longReturns the integer value of the specified configuration property, with variable substitution.Returns the parent configuration, if any.getUndecored(@NotBlank 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
public Boolean getBoolean(@NotBlank @NotBlank String key, @NotNull @NotNull Supplier<Boolean> defaultValue) 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
public Integer getInteger(@NotBlank @NotBlank String key, @NotNull @NotNull Supplier<Integer> defaultValue) 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.
-