Class BlobStore.OptionalOrUnknown<T>

java.lang.Object
org.nuxeo.ecm.core.blob.BlobStore.OptionalOrUnknown<T>
Enclosing interface:
BlobStore

public static class BlobStore.OptionalOrUnknown<T> extends Object
A class representing an unknown value, a missing value, or a present (non-null) value.
  • Method Details

    • unknown

      public static <T> BlobStore.OptionalOrUnknown<T> unknown()
      Returns an unknown instance.
    • missing

      public static <T> BlobStore.OptionalOrUnknown<T> missing()
      Returns a missing instance.
    • of

      public static <T> BlobStore.OptionalOrUnknown<T> of(T value)
      Returns an instance of a present, non-null value.
    • isUnknown

      public boolean isUnknown()
      Returns true if the value is unknown, otherwise false.
    • isKnown

      public boolean isKnown()
      Returns true if the value is known (missing or present), otherwise false.
    • isPresent

      public boolean isPresent()
      Returns true if the value is present, otherwise false.
    • isMissing

      public boolean isMissing()
      Returns true if the value is missing, otherwise false.
    • get

      @NotNull public T get()
      Returns the value if it is present, otherwise throws NoSuchElementException.
      Throws:
      NoSuchElementException - if there is no value present
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object