T - JSON Property Typepublic class Possible<T> extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Possible<T> |
absent()
Returns a
Possible with an absent value. |
boolean |
equals(Object o) |
T |
get()
Returns an instance of
T if this instance of Possible represents a non-absent value. |
int |
hashCode() |
boolean |
isAbsent()
Checks whether the instance of this
Possible represents an absent value. |
static <T> Possible<T> |
of(T value)
Returns a
Possible with a non-null, present value. |
String |
toString() |
public static <T> Possible<T> of(T value)
Possible with a non-null, present value.T - JSON Property Typevalue - A non-null value for a new Possible to represent.Possible whose value is always present and never null.NullPointerException - If value is null.public static <T> Possible<T> absent()
Possible with an absent value.T - JSON Property TypePossible whose value is absent, but not necessarily null.public T get()
T if this instance of Possible represents a non-absent value.T, if it is present. Guaranteed to never be null.NoSuchElementException - If the value is absent.public boolean isAbsent()
Possible represents an absent value.