Interface ConfigurationProperty


public 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 Details

    • 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

      <T> Optional<T> as(Class<T> type)

      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

      <T> Optional<T> as(Type type)

      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

      <T> Optional<T[]> asArrayOf(Class<T> type)

      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

      <T> Optional<T[]> asArrayOf(Type type)

      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

      <T> Optional<List<T>> asListOf(Class<T> type)

      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

      <T> Optional<List<T>> asListOf(Type type)

      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

      <T> Optional<Set<T>> asSetOf(Class<T> type)

      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

      <T> Optional<Set<T>> asSetOf(Type type)

      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

      Optional<Byte> 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

      Optional<Short> 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

      Optional<Integer> 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

      Optional<Long> 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

      Optional<Float> 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

      Optional<Double> 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

      Optional<Character> 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

      Optional<String> 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

      Optional<Boolean> 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

      Optional<LocalDate> 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

      Optional<Currency> 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

      Optional<Locale> 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

      Optional<File> 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

      Optional<Path> 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

      Optional<URI> 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

      Optional<URL> 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

      Optional<Pattern> 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
    • asClass

      Optional<Class<?>> asClass()

      Converts the property value to a class.

      Returns:
      an optional returning the converted value or an empty optional if the property is empty