Class PropertyLookupResult

java.lang.Object
org.apache.juneau.commons.settings.PropertyLookupResult

public final class PropertyLookupResult extends Object
Tri-state result of a property lookup.

This type disambiguates source lookup semantics:

  • Method Details

    • missing

      public static PropertyLookupResult missing()
      Returns a result indicating the key is absent in this source.
      Returns:
      A missing result.
    • present

      public static PropertyLookupResult present(Optional<String> value)
      Returns a result indicating the key is present with the specified value.
      Parameters:
      value - The value optional. Must not be null.
      Returns:
      A present result.
    • present

      public static PropertyLookupResult present(String value)
      Returns a result indicating the key is present with the specified value.
      Parameters:
      value - The value. Can be null, in which case the result is present with an empty value.
      Returns:
      A present result.
    • isPresent

      public boolean isPresent()
      Returns true if the key is present in this source.
      Returns:
      true if present.
    • value

      public Optional<String> value()
      Returns the resolved value for present results.
      Returns:
      The value, never null.