Interface ConfigurationSource


  • @Role
    public interface ConfigurationSource
    Since:
    1.6M1
    Version:
    $Id: 457bc28688d50e189a7839631f7b04c111fc4518 $
    • Method Detail

      • getProperty

        <T> T getProperty​(String key,
                          T defaultValue)
        Type Parameters:
        T - the value type
        Parameters:
        key - the property key for which we want the value
        defaultValue - the value to use if the key isn't found
        Returns:
        the property value is found or the default value if the key wasn't found
        Since:
        2.0M1
      • getProperty

        <T> T getProperty​(String key,
                          Class<T> valueClass)
        Type Parameters:
        T - the value type
        Parameters:
        key - the property key for which we want the value
        valueClass - the type of object that should be returned. The value is converted to the passed type.
        Returns:
        the property value is found. If the key wasn't found, null is returned except for the following special cases:
        • List: empty List
        • Properties: empty Properties
        Since:
        2.0M1
      • getProperty

        default <T> T getProperty​(String key,
                                  Class<T> valueClass,
                                  T defaultValue)
        Type Parameters:
        T - the value type
        Parameters:
        key - the property key for which we want the value
        valueClass - the type of object that should be returned. The value is converted to the passed type.
        defaultValue - the value to use if the key isn't found
        Returns:
        the property value is found or the default value if the key wasn't found.
        Since:
        12.0RC1
      • getProperty

        <T> T getProperty​(String key)
        Type Parameters:
        T - the value type
        Parameters:
        key - the property key for which we want the value
        Returns:
        the property as an untyped Object or null if the key wasn't found. In general you should prefer getProperty(String, Class) or getProperty(String, Object)
      • getKeys

        List<String> getKeys()
        Returns:
        the list of available keys in the configuration source
      • containsKey

        boolean containsKey​(String key)
        Parameters:
        key - the key to check
        Returns:
        true if the key is present in the configuration source or false otherwise
      • isEmpty

        boolean isEmpty()
        Returns:
        true if the configuration source doesn't have any key or false otherwise