Class ConfigurationChain

    • Constructor Detail

      • ConfigurationChain

        public ConfigurationChain​(Configuration configuration)
    • Method Detail

      • isSet

        public boolean isSet()
        Description copied from interface: Configuration
        Checks if this source has some configuration set.
        Specified by:
        isSet in interface Configuration
        Returns:
        true if this source holds any configuration value.
      • asInt

        public int asInt()
        Description copied from interface: Configuration
        Gets the value of this configuration as an int.
        Specified by:
        asInt in interface Configuration
        Returns:
        an int value defined by this configuration.
      • asLong

        public long asLong()
        Description copied from interface: Configuration
        Gets the value of this configuration as an long.
        Specified by:
        asLong in interface Configuration
        Returns:
        a long value defined by this configuration.
      • asBoolean

        public boolean asBoolean()
        Description copied from interface: Configuration
        Gets the value of this configuration as an boolean.
        Specified by:
        asBoolean in interface Configuration
        Returns:
        a boolean value defined by this configuration.
      • read

        public String read()
        Description copied from interface: Configuration
        Assumes this configuration value is pointing to an external location and reads the value at that location.
        Specified by:
        read in interface Configuration
        Returns:
        the value stored in the location defined by this configuration.
      • readLines

        public List<String> readLines()
        Description copied from interface: Configuration
        Assumes this configuration value is pointing to an external location and reads the lines at that location.
        Specified by:
        readLines in interface Configuration
        Returns:
        the lines stored in the location defined by this configuration.
      • or

        public Configuration or​(Configuration defaultConfiguration)
        Description copied from interface: Configuration
        Returns this configuration if it's set or the given default configuration otherwise.
        Specified by:
        or in interface Configuration
        Parameters:
        defaultConfiguration - the default configuration to return
        Returns:
        this configuration or the default one
      • orElse

        public String orElse​(String defaultValue)
        Description copied from interface: Configuration
        Returns this configuration value if it's set, otherwise returns the given defaultValue.
        Specified by:
        orElse in interface Configuration
        Parameters:
        defaultValue - the default value to return
        Returns:
        this configuration value or the default value in case this configuration is not set.
      • orElse

        public int orElse​(int defaultValue)
        Description copied from interface: Configuration
        Returns this configuration value if it's set, otherwise returns the given defaultValue.
        Specified by:
        orElse in interface Configuration
        Parameters:
        defaultValue - the default value to return
        Returns:
        this configuration value or the default value in case this configuration is not set.
      • orElse

        public long orElse​(long defaultValue)
        Description copied from interface: Configuration
        Returns this configuration value if it's set, otherwise returns the given defaultValue.
        Specified by:
        orElse in interface Configuration
        Parameters:
        defaultValue - the default value to return
        Returns:
        this configuration value or the default value in case this configuration is not set.
      • orElse

        public boolean orElse​(boolean defaultValue)
        Description copied from interface: Configuration
        Returns this configuration value if it's set, otherwise returns the given defaultValue.
        Specified by:
        orElse in interface Configuration
        Parameters:
        defaultValue - the default value to return
        Returns:
        this configuration value or the default value in case this configuration is not set.