Interface ConfigurationDataRetriever<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Object get​(String key)
      Returns the object associated with the specified key.
      String getAsString()
      Returns a string representation of the bean used by this data retriever, typically for manual handling and/or troubleshooting purposes.
      T getBean()
      Returns the configuration bean used by this data retriever, typically for manual handling and/or troubleshooting purposes.
      Boolean getBoolean​(String key)
      Returns the Boolean object associated with the specified key.
      Double getDouble​(String key)
      Returns the Double object associated with the specified key.
      Integer getInteger​(String key)
      Returns the Integer object associated with the specified key.
      Long getLong​(String key)
      Returns the Long object associated with the specified key.
      Boolean getMandatoryBoolean​(String key)
      Returns the Boolean object associated with the specified key, throwing an exception if not found.
      Double getMandatoryDouble​(String key)
      Returns the Double object associated with the specified key, throwing an exception if not found.
      Integer getMandatoryInteger​(String key)
      Returns the Integer object associated with the specified key, throwing an exception if not found.
      Long getMandatoryLong​(String key)
      Returns the Long object associated with the specified key, throwing an exception if not found.
      String getMandatoryString​(String key)
      Returns the String object associated with the specified key, throwing an exception if not found.
      String getString​(String key)
      Returns the String object associated with the specified key.
    • Method Detail

      • getBean

        T getBean()
        Returns the configuration bean used by this data retriever, typically for manual handling and/or troubleshooting purposes.
        Returns:
        the configuration bean (Note: it can be null if the Configuration is marked as optional)
      • getAsString

        String getAsString()
        Returns a string representation of the bean used by this data retriever, typically for manual handling and/or troubleshooting purposes.
        Returns:
        a string representation of the configuration bean (Note: it can be null if the Configuration is marked as optional)
        Since:
        2.5.0
      • get

        Object get​(String key)
        Returns the object associated with the specified key.

        Notes:

        • The actual return type may vary depending on the underlying implementation
        • On a JSON implementation, the return will usually be an array
        Parameters:
        key - the object key (some implementations may also accept a path expression, e.g: JSONPath)
        Returns:
        the object object associated with the specified key. Depending on the actual implementation, the result may be either null or an empty array if the specified key is not found
        Since:
        1.2.0
      • getBoolean

        Boolean getBoolean​(String key)
        Returns the Boolean object associated with the specified key.
        Parameters:
        key - the object key (some implementations may also accept a path expression, e.g: JSONPath)
        Returns:
        the Boolean object associated with the specified key; null if not found
      • getInteger

        Integer getInteger​(String key)
        Returns the Integer object associated with the specified key.
        Parameters:
        key - the object key (some implementations may also accept a path expression, e.g: JSONPath
        Returns:
        the Integer object associated with the specified key; null if not found
        Throws:
        NumberFormatException - if the value is not a parsable int.
      • getLong

        Long getLong​(String key)
        Returns the Long object associated with the specified key.
        Parameters:
        key - the object key (some implementations may also accept a path expression, e.g: JSONPath
        Returns:
        the Long object associated with the specified key; null if not found
        Throws:
        NumberFormatException - if the value is not a parsable long.
      • getDouble

        Double getDouble​(String key)
        Returns the Double object associated with the specified key.
        Parameters:
        key - the object key (some implementations may also accept a path expression, e.g: JSONPath
        Returns:
        the Double object associated with the specified key; null if not found
        Throws:
        NumberFormatException - if the value is not a parsable double.
      • getString

        String getString​(String key)
        Returns the String object associated with the specified key.
        Parameters:
        key - the object key (some implementations may also accept a path expression, e.g: JSONPath)
        Returns:
        the String object associated with the specified key; null if not found
      • getMandatoryBoolean

        Boolean getMandatoryBoolean​(String key)
        Returns the Boolean object associated with the specified key, throwing an exception if not found.
        Parameters:
        key - the object key (some implementations may also accept a path expression, e.g: JSONPath)
        Returns:
        the Boolean value associated with the specified key; never null
        Throws:
        ConfigurationException - if the specified key (or path) is not found.
        Since:
        0.4.0
      • getMandatoryInteger

        Integer getMandatoryInteger​(String key)
        Returns the Integer object associated with the specified key, throwing an exception if not found.
        Parameters:
        key - the object key (some implementations may also accept a path expression, e.g: JSONPath)
        Returns:
        the Integer object associated with the specified key; never null
        Throws:
        ConfigurationException - if the specified key (or path) is not found.
        NumberFormatException - if the value is not a parsable int.
        Since:
        0.4.0
      • getMandatoryLong

        Long getMandatoryLong​(String key)
        Returns the Long object associated with the specified key, throwing an exception if not found.
        Parameters:
        key - the object key (some implementations may also accept a path expression, e.g: JSONPath)
        Returns:
        the Long object associated with the specified key; never null
        Throws:
        ConfigurationException - if the specified key (or path) is not found.
        NumberFormatException - if the value is not a parsable long.
        Since:
        0.4.0
      • getMandatoryDouble

        Double getMandatoryDouble​(String key)
        Returns the Double object associated with the specified key, throwing an exception if not found.
        Parameters:
        key - the object key (some implementations may also accept a path expression, e.g: JSONPath)
        Returns:
        the Double object associated with the specified key; never null
        Throws:
        ConfigurationException - if the specified key (or path) is not found.
        NumberFormatException - if the value is not a parsable double.
        Since:
        0.4.0
      • getMandatoryString

        String getMandatoryString​(String key)
        Returns the String object associated with the specified key, throwing an exception if not found.
        Parameters:
        key - the object key (some implementations may also accept a path expression, e.g: JSONPath)
        Returns:
        the String object associated with the specified key; never null
        Throws:
        ConfigurationException - if the specified key (or path) is not found.
        Since:
        0.4.0