Package org.nuxeo.ecm.core.blob
Class BlobStore.OptionalOrUnknown<T>
java.lang.Object
org.nuxeo.ecm.core.blob.BlobStore.OptionalOrUnknown<T>
- Enclosing interface:
- BlobStore
A class representing an unknown value, a missing value, or a present (non-null) value.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanget()Returns the value if it is present, otherwise throwsNoSuchElementException.inthashCode()booleanisKnown()Returnstrueif the value is known (missing or present), otherwisefalse.booleanReturnstrueif the value is missing, otherwisefalse.booleanReturnstrueif the value is present, otherwisefalse.booleanReturnstrueif the value is unknown, otherwisefalse.static <T> BlobStore.OptionalOrUnknown<T>missing()Returns a missing instance.static <T> BlobStore.OptionalOrUnknown<T>of(T value) Returns an instance of a present, non-null value.static <T> BlobStore.OptionalOrUnknown<T>unknown()Returns an unknown instance.
-
Method Details
-
unknown
Returns an unknown instance. -
missing
Returns a missing instance. -
of
Returns an instance of a present, non-null value. -
isUnknown
public boolean isUnknown()Returnstrueif the value is unknown, otherwisefalse. -
isKnown
public boolean isKnown()Returnstrueif the value is known (missing or present), otherwisefalse. -
isPresent
public boolean isPresent()Returnstrueif the value is present, otherwisefalse. -
isMissing
public boolean isMissing()Returnstrueif the value is missing, otherwisefalse. -
get
Returns the value if it is present, otherwise throwsNoSuchElementException.- Throws:
NoSuchElementException- if there is no value present
-
equals
-
hashCode
public int hashCode()
-