T
- The type of the optional value.@Deprecated public static final class Option.None<T> extends Option<T> implements java.io.Serializable
Option
.Option.None<T>, Option.Some<T>
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Deprecated.
Clarifies that values have a proper equals() method implemented.
|
T |
get()
Deprecated.
Gets the value if this is a
Some or throws if this is a None . |
int |
hashCode()
Deprecated.
Clarifies that values have a proper hashCode() method implemented.
|
boolean |
isEmpty()
Deprecated.
Returns true, if this is
None , otherwise false, if this is Some . |
java.lang.String |
stringPrefix()
Deprecated.
Returns the name of this Value type, which is used by toString().
|
java.lang.String |
toString()
Deprecated.
Clarifies that values have a proper toString() method implemented.
|
collect, filter, filterNot, flatMap, fold, getOrElse, getOrElse, getOrElseThrow, isAsync, isDefined, isLazy, isSingleValued, iterator, map, narrow, none, of, ofOptional, onEmpty, orElse, orElse, orNull, peek, peek, sequence, some, transform, traverse, when, when
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
collect, collect, contains, corresponds, eq, exists, forAll, forEach, getOrElseTry, getOrNull, narrow, out, out, spliterator, stderr, stdout, toArray, toCharSeq, toCompletableFuture, toEither, toEither, toInvalid, toInvalid, toJavaArray, toJavaArray, toJavaArray, toJavaCollection, toJavaList, toJavaList, toJavaMap, toJavaMap, toJavaMap, toJavaOptional, toJavaParallelStream, toJavaSet, toJavaSet, toJavaStream, toLeft, toLeft, toLinkedMap, toLinkedMap, toLinkedSet, toList, toMap, toMap, toOption, toPriorityQueue, toPriorityQueue, toQueue, toRight, toRight, toSet, toSortedMap, toSortedMap, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toStream, toTree, toTree, toTry, toTry, toValid, toValid, toValidation, toValidation, toVector
public T get()
Option
Some
or throws if this is a None
.
// Prints "57"
System.out.println(Option.of(57).get());
// Throws a NoSuchElementException
Option.none().get();
public boolean isEmpty()
Option
None
, otherwise false, if this is Some
.
// Prints "false"
System.out.println(Option.of(10).isEmpty());
// Prints "true"
System.out.println(Option.none().isEmpty());
public boolean equals(java.lang.Object o)
Value
public int hashCode()
Value
See Object.hashCode().
public java.lang.String stringPrefix()
Value
stringPrefix
in interface Value<T>
public java.lang.String toString()
Value
See Object.toString().