Class ConfigProperties

java.lang.Object
io.strimzi.kafka.oauth.common.ConfigProperties

public class ConfigProperties extends Object
A helper class to apply configuration override mechanism to a java.util.Properties object. See Config.getValue(String, String).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a new instance for existing java.util.Properties object
  • Method Summary

    Modifier and Type
    Method
    Description
    static Properties
    resolve(Properties defaults)
    Apply the config override mechanism to all the keys in java.util.Properties object passed as defaults, storing the resolved configuration values into a new java.util.Properties object that is returned as a result.
    static void
    Apply the config override mechanism to all the keys in the passed java.util.Properties object using it as the final fallback for value resolution.
    resolveTo(Properties destination)
    Apply the config override mechanism to all the keys in java.util.Properties object used to initialise this ConfigProperties storing the resolved configuration values to the passed destination object.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConfigProperties

      public ConfigProperties(Properties defaults)
      Construct a new instance for existing java.util.Properties object
      Parameters:
      defaults - A java.util.Properties object that serves as the source of keys, and the final fallback source for values if no override is found for a config option
  • Method Details

    • resolveTo

      public Properties resolveTo(Properties destination)
      Apply the config override mechanism to all the keys in java.util.Properties object used to initialise this ConfigProperties storing the resolved configuration values to the passed destination object.
      Parameters:
      destination - The destination java.util.Properties object
      Returns:
      The passed destination object
    • resolveAndExportToSystemProperties

      public static void resolveAndExportToSystemProperties(Properties defaults)
      Apply the config override mechanism to all the keys in the passed java.util.Properties object using it as the final fallback for value resolution. The resolved config values are set as System properties.
      Parameters:
      defaults - A java.util.Properties object that serves as the source of keys, and the final fallback source for values if no override is found for a config option
    • resolve

      public static Properties resolve(Properties defaults)
      Apply the config override mechanism to all the keys in java.util.Properties object passed as defaults, storing the resolved configuration values into a new java.util.Properties object that is returned as a result.
      Parameters:
      defaults - A java.util.Properties object that serves as the source of keys, and the final fallback source for values if no override is found for a config option
      Returns:
      New java.util.Properties object with resolved configuration values