Interface ConfigurationService

    • Method Detail

      • getString

        String getString​(String key,
                         String defaultValue)
        Returns the given property value if any, otherwise returns the given default value.
        Parameters:
        key - the property key
        defaultValue - the default value for this key
        Since:
        11.1
      • getInteger

        int getInteger​(String key,
                       int defaultValue)
        Returns the given property value if any, otherwise returns the given default value.
        Parameters:
        key - the property key
        defaultValue - the default value for this key
        Since:
        11.1
      • getLong

        Optional<LonggetLong​(String key)
        Returns the given property value if any.
        Parameters:
        key - the property key
        Since:
        11.1
      • getLong

        long getLong​(String key,
                     long defaultValue)
        Returns the given property value if any, otherwise returns the given default value.
        Parameters:
        key - the property key
        defaultValue - the default value for this key
        Since:
        11.1
      • isBooleanTrue

        boolean isBooleanTrue​(String key)
        Returns true if given property exists and is true when compared to a boolean value.
         prop=true  | isBooleanTrue("prop") = true
         prop=trUe  | isBooleanTrue("prop") = true
         prop=false | isBooleanTrue("prop") = false
         prop=any   | isBooleanTrue("prop") = false
         prop=      | isBooleanTrue("prop") = false
         
        Since:
        11.1
      • isBooleanFalse

        boolean isBooleanFalse​(String key)
        Returns true if given property exists and is false when compared to a boolean value.
         prop=false | isBooleanFalse("prop") = true
         prop=fAlse | isBooleanFalse("prop") = true
         prop=true  | isBooleanFalse("prop") = false
         prop=any   | isBooleanFalse("prop") = false
         prop=      | isBooleanFalse("prop") = false
         
        Since:
        11.1
      • getDuration

        Duration getDuration​(String key,
                             Duration defaultValue)
        Returns the given property value if any, otherwise returns the given default value.
        Parameters:
        key - the property key
        defaultValue - the default value for this key
        Since:
        11.1
      • getProperties

        Map<String,​SerializablegetProperties​(String namespace)
        Returns the properties with key starting with the given namespace.
        Parameters:
        namespace - the namespace
        Returns:
        a map of properties with trimmed keys (namespace removed)
        Since:
        10.3
      • getPropertiesAsJson

        String getPropertiesAsJson​(String namespace)
                            throws IOException
        Returns the json string representing the properties with key starting with the given namespace.
        Parameters:
        namespace - the namespace of the properties
        Throws:
        IOException
        Since:
        10.3