Interface ConfigurationSource

All Known Implementing Classes:
BaseConfigurationSource, EnvironmentConfigurationSource, FileConfigurationSource, MultipleConfigurationSource, ResourceConfigurationSource

public interface ConfigurationSource
  • Method Details

    • getBoolean

      Optional<Boolean> getBoolean(String property)
      Retrieve the boolean value of a property.
      Parameters:
      property - the property name
      Returns:
      the boolean wrapped into an Optional
    • requireBoolean

      default Boolean requireBoolean(String property)
      Retrieve the boolean value of a required property.
      Parameters:
      property - the property name
      Returns:
      the boolean value
      Throws:
      MissingConfigurationException - if the property is not available in this source
    • getString

      Optional<String> getString(String property)
      Retrieve the string value of a property.
      Parameters:
      property - the property name
      Returns:
      the string wrapped into an Optional
    • requireString

      default String requireString(String property)
      Retrieve the string value of a required property.
      Parameters:
      property - the property name
      Returns:
      the string value
      Throws:
      MissingConfigurationException - if the property is not available in this source
    • getInteger

      Optional<Integer> getInteger(String property)
      Retrieve the integer value of a property.
      Parameters:
      property - the property name
      Returns:
      the integer wrapped into an Optional
    • requireInteger

      default Integer requireInteger(String property)
      Retrieve the integer value of a required property.
      Parameters:
      property - the property name
      Returns:
      the integer value
      Throws:
      MissingConfigurationException - if the property is not available in this source
    • getLong

      Optional<Long> getLong(String property)
      Retrieve the long value of a property.
      Parameters:
      property - the property name
      Returns:
      the long wrapped into an Optional
    • requireLong

      default Long requireLong(String property)
      Retrieve the long value of a required property.
      Parameters:
      property - the property name
      Returns:
      the long value
      Throws:
      MissingConfigurationException - if the property is not available in this source
    • getFloat

      Optional<Float> getFloat(String property)
      Retrieve the float value of a property.
      Parameters:
      property - the property name
      Returns:
      the float wrapped into an Optional
    • requireFloat

      default Float requireFloat(String property)
      Retrieve the float value of a required property.
      Parameters:
      property - the property name
      Returns:
      the float value
      Throws:
      MissingConfigurationException - if the property is not available in this source
    • getDouble

      Optional<Double> getDouble(String property)
      Retrieve the double value of a property.
      Parameters:
      property - the property name
      Returns:
      the double wrapped into an Optional
    • requireDouble

      default Double requireDouble(String property)
      Retrieve the double value of a required property.
      Parameters:
      property - the property name
      Returns:
      the double value
      Throws:
      MissingConfigurationException - if the property is not available in this source
    • getList

      <T> Optional<List<T>> getList(String property, Class<T> itemClass)
      Retrieve the list value of a property.
      Type Parameters:
      T - the type of item of the list
      Parameters:
      property - the property name
      itemClass - the type of item of the list.
      Returns:
      the list wrapped into an Optional
    • requireList

      default <T> List<T> requireList(String property, Class<T> itemClass)
      Retrieve the list value of a required property.
      Type Parameters:
      T - the type of item of the list
      Parameters:
      property - the property name
      itemClass - the type of item of the list.
      Returns:
      the list value
      Throws:
      MissingConfigurationException - if the property is not available in this source
    • getPropertyNames

      Set<String> getPropertyNames()
      Retrieves the names of all the available properties.
      Returns:
      the set of property names
    • toProperties

      Properties toProperties()
      Converts this configuration source to a Properties object.
      Returns:
      all the properties value stored into Properties object