Interface ConfigurationProperty
A configuration property.
A configuration property is identified by a configuration key which is composed of a name and a collection of parameters defining the context for which a property value is defined. This means that for a given property name, multiple values can be defined in a configuration source for different contexts.
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> Optional
<T> Converts the property value to the specified type.<T> Optional
<T> Converts the property value to the specified type.<T> Optional
<T[]> Converts the property value to an array of the specified type.<T> Optional
<T[]> Converts the property value to an array of the specified type.Converts the property value to a big decimal.Converts the property value to a big integer.Converts the property value to a boolean.asByte()
Converts the property value to a byte.Converts the property value to a character.asClass()
Converts the property value to a class.Converts the property value to a currency.asDouble()
Converts the property value to a double.asFile()
Converts the property value to a file.asFloat()
Converts the property value to a float.Converts the property value to an inet address.Converts the property value to an inet socket address.Converts the property value to an integer.Converts the property value to a list of the specified type.Converts the property value to a list of the specified type.Converts the property value to a local date.Converts the property value to a local date time.asLocale()
Converts the property value to a locale.asLong()
Converts the property value to a long.asPath()
Converts the property value to a path.Converts the property value to a pattern.Converts the property value to a set of the specified type.Converts the property value to a set of the specified type.asShort()
Converts the property value to a short.asString()
Converts the property value to a string.asURI()
Converts the property value to a URI.asURL()
Converts the property value to a URL.Converts the property value to a zoned date time.getKey()
Returns the key identifying the property and the context in which it has been defined.ConfigurationSource
<?, ?, ?> Returns the configuration source that loaded the property.boolean
isEmpty()
Determines whether the value is empty (ie. value is null).boolean
Determines whether the value is present (ie. value is not null).boolean
isUnset()
Determines whether this property is unset.
-
Method Details
-
getKey
ConfigurationKey getKey()Returns the key identifying the property and the context in which it has been defined.
- Returns:
- a configuration key
-
getSource
ConfigurationSource<?,?, getSource()?> Returns the configuration source that loaded the property.
- Returns:
- a configuration source.
-
isUnset
boolean isUnset()Determines whether this property is unset.
Unset properties are always empty, they are used in a
CompositeConfigurationSource
to cancel non-empty properties retrieved from sources with lower priority.- Returns:
- true if the property is unset, false otherwise
-
isPresent
boolean isPresent()Determines whether the value is present (ie. value is not null).
- Returns:
- true if the property value is not null, false otherwise
-
isEmpty
boolean isEmpty()Determines whether the value is empty (ie. value is null).
- Returns:
- true if the property value is null, false otherwise
-
as
Converts the property value to the specified type.
- Type Parameters:
T
- the target type- Parameters:
type
- a class of type T- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
as
Converts the property value to the specified type.
- Type Parameters:
T
- the target type- Parameters:
type
- the target type- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asArrayOf
Converts the property value to an array of the specified type.
- Type Parameters:
T
- the target component type- Parameters:
type
- a class of type T- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asArrayOf
Converts the property value to an array of the specified type.
- Type Parameters:
T
- the target component type- Parameters:
type
- the target component type- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asListOf
Converts the property value to a list of the specified type.
- Type Parameters:
T
- the target list argument type- Parameters:
type
- a class of type T- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asListOf
Converts the property value to a list of the specified type.
- Type Parameters:
T
- the target list argument type- Parameters:
type
- the target list argument type- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asSetOf
Converts the property value to a set of the specified type.
- Type Parameters:
T
- the target set argument type- Parameters:
type
- a class of type T- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asSetOf
Converts the property value to a set of the specified type.
- Type Parameters:
T
- the target set argument type- Parameters:
type
- the target set argument type- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asByte
Converts the property value to a byte.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asShort
Converts the property value to a short.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asInteger
Converts the property value to an integer.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asLong
Converts the property value to a long.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asFloat
Converts the property value to a float.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asDouble
Converts the property value to a double.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asCharacter
Converts the property value to a character.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asString
Converts the property value to a string.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asBoolean
Converts the property value to a boolean.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asBigInteger
Optional<BigInteger> asBigInteger()Converts the property value to a big integer.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asBigDecimal
Optional<BigDecimal> asBigDecimal()Converts the property value to a big decimal.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asLocalDate
Converts the property value to a local date.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asLocalDateTime
Optional<LocalDateTime> asLocalDateTime()Converts the property value to a local date time.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asZonedDateTime
Optional<ZonedDateTime> asZonedDateTime()Converts the property value to a zoned date time.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asCurrency
Converts the property value to a currency.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asLocale
Converts the property value to a locale.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asFile
Converts the property value to a file.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asPath
Converts the property value to a path.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asURI
Converts the property value to a URI.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asURL
Converts the property value to a URL.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asPattern
Converts the property value to a pattern.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asInetAddress
Optional<InetAddress> asInetAddress()Converts the property value to an inet address.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asInetSocketAddress
Optional<InetSocketAddress> asInetSocketAddress()Converts the property value to an inet socket address.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-
asClass
Converts the property value to a class.
- Returns:
- an optional returning the converted value or an empty optional if the property is empty
-