Class ConfigurationBridge

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.String> get​(java.lang.String key)
      The effective value of the specified property.
      java.lang.String[] getStringArray​(java.lang.String key)
      Used to read multi-valued properties.
      boolean hasKey​(java.lang.String key)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConfigurationBridge

        public ConfigurationBridge​(Settings settings)
    • Method Detail

      • get

        public java.util.Optional<java.lang.String> get​(java.lang.String key)
        Description copied from interface: Configuration
        The effective value of the specified property. Can return Optional#empty() if the property is not set and has no defined default value.

        If the property is encrypted with a secret key, then the returned value is decrypted.

        Specified by:
        get in interface Configuration
      • hasKey

        public boolean hasKey​(java.lang.String key)
        Specified by:
        hasKey in interface Configuration
        Returns:
        true if the property has a non-default value, else false.
      • getStringArray

        public java.lang.String[] getStringArray​(java.lang.String key)
        Description copied from interface: Configuration
        Used to read multi-valued properties.

        See PropertyDefinition.Builder.multiValues(boolean) Multi-valued properties coming from scanner are parsed as CSV lines (ie comma separator and optional double quotes to escape values). Non quoted values are trimmed and empty fields are ignored.
        Examples :

        • "one,two,three " -> ["one", "two", "three"]
        • " one, two, three " -> ["one", "two", "three"]
        • "one, three" -> ["one", "three"]
        • "one,"", three" -> ["one", "", "three"]
        • "one, " " , three" -> ["one", " ", "three"]
        • "one,\"two,three\",\" four \"" -> ["one", "two,three", " four "]
        Specified by:
        getStringArray in interface Configuration