Interface ConfigurationProperty<T>

All Known Subinterfaces:
OptionalConfigurationProperty<T>

public interface ConfigurationProperty<T>
  • Method Details

    • get

      Get the value of this configuration property.
      Parameters:
      source - A configuration source.
      Returns:
      The value of this property according to the given source.
    • getAndTransform

      <R> R getAndTransform(ConfigurationPropertySource source, Function<T,R> transform)
      Get and transform the value of this configuration property.

      Any exception occurring during transformation will be wrapped in another exception adding some context, such as the resolved key for this property.

      Type Parameters:
      R - The transformed type.
      Parameters:
      source - A configuration source.
      transform - A transform function to be applied to the value of this configuration property before returning the result.
      Returns:
      The value of this property according to the given source.
    • resolve

      Resolve the key for this configuration property as registered in the underlying configuration source, if possible.

      Useful for error messages addressed to the user.

      Parameters:
      source - A configuration source.
      Returns:
      The value of this property according to the given source.
      See Also:
    • resolveOrRaw

      String resolveOrRaw(ConfigurationPropertySource source)
      Resolve the key for this configuration property as registered in the underlying configuration source, or, if not possible, just return the "raw" key passed to forKey(String).

      Useful for debugging.

      Parameters:
      source - A configuration source.
      Returns:
      The value of this property according to the given source.
      See Also:
    • forKey

      static KeyContext forKey(String key)
      Start the creation of a configuration property.
      Parameters:
      key - The key for that configuration property.
      Returns:
      A context allowing to further define the configuration property.