Class ConfBuilder

  • All Implemented Interfaces:
    Conf

    public class ConfBuilder
    extends Object
    implements Conf
    Helper class which can be used for building new Conf instance.
    • Method Detail

      • getString

        public String getString​(String path)
        Gets a required parameter a a string.
        Specified by:
        getString in interface Conf
        Parameters:
        path - the parameter path.
        Returns:
        the parameter value as a string.
      • getLong

        public long getLong​(String path)
        Gets a required parameter as a long.
        Specified by:
        getLong in interface Conf
        Parameters:
        path - the parameter path.
        Returns:
        the parameter value as a long.
      • getInt

        public int getInt​(String path)
        Gets a required parameter as an integer.
        Specified by:
        getInt in interface Conf
        Parameters:
        path - the parameter path.
        Returns:
        the parameter value as a int.
      • getBoolean

        public boolean getBoolean​(String path)
        Gets a required parameter as an boolean.
        Specified by:
        getBoolean in interface Conf
        Parameters:
        path - the parameter path.
        Returns:
        the parameter value as a boolean.
      • getDouble

        public double getDouble​(String path)
        Gets a required parameter as a double.
        Specified by:
        getDouble in interface Conf
        Parameters:
        path - the parameter path.
        Returns:
        the parameter value as a double.
      • getStringList

        public List<String> getStringList​(String path)
        Description copied from interface: Conf
        Gets a required parameter as a list.
        Specified by:
        getStringList in interface Conf
        Parameters:
        path - the parameter path.
        Returns:
        a string list value.
      • getSubConf

        public Conf getSubConf​(String path)
        Gets a required parameter as a Conf.
        Specified by:
        getSubConf in interface Conf
        Parameters:
        path - the parameter path.
        Returns:
        a new Conf instance.
      • getSubConfList

        public List<Conf> getSubConfList​(String path)
        Gets a required parameter as a list of Conf.
        Specified by:
        getSubConfList in interface Conf
        Parameters:
        path - the parameter path.
        Returns:
        a new list of Conf instances.
      • hasPath

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

        public <T> Collection<T> getClasses​(String path,
                                            Class<T> type)
        Gets a required parameter as a list of instances of type Conf.
        Specified by:
        getClasses in interface Conf
        Type Parameters:
        T - the expected type.
        Parameters:
        path - the parameter path.
        type - the class of the .
        Returns:
        a new Collection of Conf.
      • getClass

        public <T> T getClass​(String path,
                              Class<T> type)
        Gets a required parameter as an instances of type Conf.
        Specified by:
        getClass in interface Conf
        Type Parameters:
        T - the expected type.
        Parameters:
        path - the parameter path.
        type - the class of the .
        Returns:
        a new Collection of Conf.
      • getConfAsMap

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

        public Conf build()