Interface Conf

    • Method Detail

      • of

        static Conf of​(String k1,
                       Object v1)
        Static helper that can be used to create a new empty Conf instance using the specified key-value pair.
        Returns:
        a new Conf instance.
      • of

        static Conf of​(String k1,
                       Object v1,
                       String k2,
                       Object v2)
        Static helper that can be used to create a new empty Conf instance using the specified key-value pair.
        Returns:
        a new Conf instance.
      • of

        static Conf of​(Map<String,​Object> map)
        Static helper that can be used to create a new empty Conf instance using the specified Map.
        Returns:
        a new Conf instance.
      • of

        static Conf of​(Conf... configurations)
        Static helper that can be used to merge multiple Conf instances.
        Returns:
        a new Conf instance.
      • of

        static Conf of​(Collection<? extends Conf> configurations)
        Static helper that can be used to merge multiple Conf instances.
        Returns:
        a new Conf instance.
      • empty

        static Conf empty()
        Static helper that can be used to creates a new empty Conf instance.
        Returns:
        a new Conf instance.
      • getValue

        Object getValue​(String path)
        Gets a required parameter value.
        Parameters:
        path - the parameter path.
        Returns:
        the object value.
      • keySet

        Set<String> keySet()
        Returns a Set view of the keys contained in this conf.
        Returns:
        a set view of the keys contained in this conf
      • getString

        String getString​(String path)
        Gets a required parameter as a string.
        Parameters:
        path - the parameter path.
        Returns:
        the parameter value as a string.
        Throws:
        MissingConfException - if no parameter can be found for the specified path.
      • getOptionalString

        default Optional<String> getOptionalString​(String path)
        Gets an optional parameter as a string.
        Parameters:
        path - the parameter path.
        Returns:
        the Optional value.
      • getLong

        long getLong​(String path)
        Gets a required parameter as a long.
        Parameters:
        path - the parameter path.
        Returns:
        the parameter value as a long.
        Throws:
        MissingConfException - if no parameter can be found for the specified path.
      • getOptionalLong

        default Optional<Long> getOptionalLong​(String path)
        Gets an optional parameter as a long.
        Parameters:
        path - the parameter path.
        Returns:
        the Optional value.
      • getInt

        int getInt​(String path)
        Gets a required parameter as an integer.
        Parameters:
        path - the parameter path.
        Returns:
        the parameter value as a int.
        Throws:
        MissingConfException - if no parameter can be found for the specified path.
      • getOptionalInt

        default Optional<Integer> getOptionalInt​(String path)
        Gets an optional parameter as an integer.
        Parameters:
        path - the parameter path.
        Returns:
        the Optional value.
      • getBoolean

        boolean getBoolean​(String path)
        Gets a required parameter as an boolean.
        Parameters:
        path - the parameter path.
        Returns:
        the parameter value as a boolean.
        Throws:
        MissingConfException - if no parameter can be found for the specified path.
      • getOptionalBoolean

        default Optional<Boolean> getOptionalBoolean​(String path)
        Gets an optional parameter as an boolean.
        Parameters:
        path - the parameter path.
        Returns:
        the Optional value.
      • getDouble

        double getDouble​(String path)
        Gets a required parameter as a double.
        Parameters:
        path - the parameter path.
        Returns:
        the parameter value as a double.
        Throws:
        MissingConfException - if no parameter can be found for the specified path.
      • getOptionalDouble

        default Optional<Double> getOptionalDouble​(String path)
        Gets an optional parameter as an double.
        Parameters:
        path - the parameter path.
        Returns:
        the Optional value.
      • getStringList

        List<String> getStringList​(String path)
        Gets a required parameter as a list.
        Parameters:
        path - the parameter path.
        Returns:
        a string list value.
        Throws:
        MissingConfException - if no parameter can be found for the specified path.
      • getSubConf

        Conf getSubConf​(String path)
        Gets a required parameter as a Conf.
        Parameters:
        path - the parameter path.
        Returns:
        a new Conf instance.
        Throws:
        MissingConfException - if no parameter can be found for the specified path.
      • getSubConfList

        List<Conf> getSubConfList​(String path)
        Gets a required parameter as a list of Conf.
        Parameters:
        path - the parameter path.
        Returns:
        a new list of Conf instances.
        Throws:
        MissingConfException - if no parameter can be found for the specified path.
      • hasPath

        boolean hasPath​(String path)
        Checks whether the specified path exists into this Conf.
        Parameters:
        path - the path to be checked.
        Returns:
        true if the path exists, false otherwise.
      • withFallback

        Conf withFallback​(Conf fallback)
      • getClasses

        <T> Collection<T> getClasses​(String path,
                                     Class<T> type)
        Gets a required parameter as a list of instances of type Conf.
        Type Parameters:
        T - the expected type.
        Parameters:
        path - the parameter path.
        type - the class of the .
        Returns:
        a new Collection of Conf.
        Throws:
        MissingConfException - if no parameter can be found for the specified path.
      • getClass

        <T> T getClass​(String path,
                       Class<T> type)
        Gets a required parameter as an instances of type Conf.
        Type Parameters:
        T - the expected type.
        Parameters:
        path - the parameter path.
        type - the class of the .
        Returns:
        a new Collection of Conf.
        Throws:
        MissingConfException - if no parameter can be found for the specified path.
      • getConfAsMap

        Map<String,​Object> getConfAsMap()
        Converts this Conf into a path-value map.
        Returns:
        a new Map instance containing the configuration values.
      • getConfAsProperties

        Properties getConfAsProperties()
        Converts this Conf into a properties.
        Returns:
        a new Properties instance containing the configuration values.