java.lang.Object
dev.orne.config.impl.AbstractConfig
dev.orne.config.impl.CommonsConfigImpl
- All Implemented Interfaces:
Config
Implementation of
Config based on Apache Commons
ImmutableConfiguration.- Since:
- 0.2
- Version:
- 1.0, 2020-09
- Author:
- (w) Iker Hernaez
- See Also:
-
ImmutableConfiguration
-
Field Summary
Fields inherited from class dev.orne.config.impl.AbstractConfig
KEY_BLANK_ERR -
Constructor Summary
ConstructorsConstructorDescriptionCommonsConfigImpl(@NotNull ConfigOptions options, @NotNull CommonsConfigOptions commonsOptions) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancontainsInt(@NotBlank String key) Returnstrueif the property with the key passed as argument has been configured in this configuration instance.protected @NotNull org.apache.commons.configuration2.ImmutableConfigurationReturns the delegated Apache Commons configuration.protected StringReturns the value of the configuration property asString.Returns the configuration property keys contained in this configuration instance .protected booleanReturnstrueif this configuration instance contains no property.Methods inherited from class dev.orne.config.impl.AbstractConfig
contains, get, getDecoder, getDecorator, getKeys, getParent, getResolver, getUndecored, isEmpty, isOverrideParentPropertiesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.orne.config.Config
as, get, get, getBoolean, getBoolean, getBoolean, getInteger, getInteger, getInteger, getKeys, getKeys, getLong, getLong, getLong, subset
-
Constructor Details
-
CommonsConfigImpl
public CommonsConfigImpl(@NotNull @NotNull ConfigOptions options, @NotNull @NotNull CommonsConfigOptions commonsOptions) Creates a new instance.- Parameters:
options- The configuration builder options.commonsOptions- The Apache Commons based configuration options.
-
-
Method Details
-
getConfig
@NotNull protected @NotNull org.apache.commons.configuration2.ImmutableConfiguration getConfig()Returns the delegated Apache Commons configuration.- Returns:
- The delegated Apache Commons configuration
-
isEmptyInt
protected boolean isEmptyInt()Returnstrueif this configuration instance contains no property.Parent configuration
- Specified by:
isEmptyIntin classAbstractConfig- Returns:
- Returns
trueif the configuration contains no property.
-
containsInt
Returnstrueif the property with the key passed as argument has been configured in this configuration instance.- Specified by:
containsIntin classAbstractConfig- Parameters:
key- The configuration property.- Returns:
- Returns
trueif the property has been configured.
-
getKeysInt
Returns the configuration property keys contained in this configuration instance .- Specified by:
getKeysIntin classAbstractConfig- Returns:
- The configuration property keys.
-
getInt
Returns the value of the configuration property asString.- Specified by:
getIntin classAbstractConfig- Parameters:
key- The configuration property.- Returns:
- The configuration parameter value.
-