Class AbstractConfig

    • Field Detail

      • SYSTEM_PROPERTY_PREFIX

        public static final java.lang.String SYSTEM_PROPERTY_PREFIX
        See Also:
        Constant Field Values
      • ENV_VARIABLE_PREFIX

        public static final java.lang.String ENV_VARIABLE_PREFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractConfig

        public AbstractConfig()
    • Method Detail

      • setSerializable

        public void setSerializable​(boolean serializable)
        Set this config to be serializable
        Parameters:
        serializable - true if serializable, false otherwise
      • getValues

        public abstract java.util.Map<? extends ConfigField,​java.lang.Object> getValues()
      • parseString

        public static java.lang.Object parseString​(java.lang.String value,
                                                   java.lang.Class type)
      • getDefault

        public static java.lang.Object getDefault​(java.lang.String schemaName,
                                                  ConfigField field,
                                                  java.lang.Object factoryDefault)
      • getValueFromEnvironment

        public static java.lang.String getValueFromEnvironment​(java.lang.String key)
        Looks up a value by a key from java properties and the system environment. Looks up the provided key first in the java system properties prefixed with SYSTEM_PROPERTY_PREFIX and returns the value if present. If it is not present, looks it up in the system environment prefixed with ENV_VARIABLE_PREFIX and returns this one if present. Returns null if the key is neither found in the properties nor in the environment.
        Parameters:
        key - the key to look up
        Returns:
        the found value or null if the key is not available
        See Also:
        SYSTEM_PROPERTY_PREFIX, ENV_VARIABLE_PREFIX, System.getProperty(String), System.getenv(String)
      • getValueFromEnvironment

        public static <T> java.util.Optional<T> getValueFromEnvironment​(java.lang.String key,
                                                                        java.lang.Class<T> type)