Interface PropertyResolver

All Known Implementing Classes:
ChainedPropertyResolver, EnvironmentVariableResolver, FileContentResolver, FlatFileResolver, JsonValueResolver, ProductPathResolver, PropertiesResolver, SystemPropertyResolver

public interface PropertyResolver
A property resolver attempt to get the value of a given config property.
  • Method Details

    • getProperty

      @Deprecated default Optional<String> getProperty(String key)
      Deprecated.
      Returns the value of the specified property. The method returns an empty Optional if the property is not found. The resolved property is considered as sensitive and will not appear in logs.
      Parameters:
      key - The name of the requested property. The key can't be null.
      Returns:
      An Optional string that contains the value of the requested property, or empty Optional if property is undefined.
      Throws:
      NullPointerException - if key is null.
    • getProperty

      Optional<String> getProperty(String key, boolean sensitive)
      Returns the value of the specified property. The method returns an empty Optional if the property is not found. The resolved property has to be considered sensitive if sensitive is true and implementations are required to handle it with special attention (no logs, ...).
      Parameters:
      key - The name of the requested property. The key can't be null.
      sensitive - true is the property value has to be considered a sensitive value (such as a password).
      Returns:
      An Optional string that contains the value of the requested property, or empty Optional if property is undefined.
      Throws:
      NullPointerException - if key is null.
    • getProperty

      @Deprecated default Optional<String> getProperty(String key, String defaultValue)
      Deprecated.
      Returns the value of the specified property. The method returns an empty Optional if the property is not found and there is no default value provided. The resolved property is considered as sensitive and will not appear in logs.
      Parameters:
      key - The name of the requested property. The key can't be null.
      defaultValue - The default value if the property is not defined.
      Returns:
      An Optional string that contains the value of the requested property, or empty Optional if property is undefined and a default is not supplied.
      Throws:
      NullPointerException - if key is null.
    • getProperty

      default Optional<String> getProperty(String key, String defaultValue, boolean sensitive)
      Returns the value of the specified property. The method returns an empty Optional if the property is not found and there is no default value provided. The resolved property has to be considered sensitive if sensitive is true and implementations are required to handle it with special attention (no logs, ...).
      Parameters:
      key - The name of the requested property. The key can't be null.
      defaultValue - The default value if the property is not defined.
      sensitive - true is the property value has to be considered a sensitive value (such as a password).
      Returns:
      An Optional string that contains the value of the requested property, or empty Optional if property is undefined and a default is not supplied.
      Throws:
      NullPointerException - if key is null.