Class PropertyLookupResult
java.lang.Object
org.apache.juneau.commons.settings.PropertyLookupResult
Tri-state result of a property lookup.
This type disambiguates source lookup semantics:
missing()- The key does not exist in the source.present(Optional)withOptional.empty()- The key exists and resolves to a null value.present(Optional)with a value - The key exists and resolves to a non-null value.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrue if the key is present in this source.static PropertyLookupResultmissing()Returns a result indicating the key is absent in this source.static PropertyLookupResultReturns a result indicating the key is present with the specified value.static PropertyLookupResultReturns a result indicating the key is present with the specified value.value()Returns the resolved value for present results.
-
Method Details
-
missing
Returns a result indicating the key is absent in this source.- Returns:
- A missing result.
-
present
Returns a result indicating the key is present with the specified value.- Parameters:
value- The value optional. Must not benull .- Returns:
- A present result.
-
present
Returns a result indicating the key is present with the specified value.- Parameters:
value- The value. Can benull , in which case the result is present with an empty value.- Returns:
- A present result.
-
isPresent
Returnstrue if the key is present in this source.- Returns:
true if present.
-
value
Returns the resolved value for present results.- Returns:
- The value, never
null .
-