Package io.vavr.control
Class Option.None<T>
- java.lang.Object
-
- io.vavr.control.Option.None<T>
-
- Type Parameters:
T- The type of the optional value.
public static final class Option.None<T> extends java.lang.Object implements Option<T>, java.io.Serializable
None is a singleton representation of the undefinedOption.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.vavr.control.Option
Option.None<T>, Option.Some<T>
-
-
Field Summary
Fields Modifier and Type Field Description private static Option.None<?>INSTANCEThe singleton instance of None.private static longserialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description privateNone()Hidden constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Clarifies that values have a proper equals() method implemented.Tget()Gets the value if this is aSomeor throws if this is aNone.inthashCode()Clarifies that values have a proper hashCode() method implemented.booleanisEmpty()Returns true, if this isNone, otherwise false, if this isSome.private java.lang.ObjectreadResolve()Instance control for object serialization.java.lang.StringstringPrefix()Returns the name of this Value type, which is used by toString().java.lang.StringtoString()Clarifies that values have a proper toString() method implemented.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.vavr.control.Option
collect, filter, flatMap, fold, getOrElse, getOrElse, getOrElseThrow, isAsync, isDefined, isLazy, isSingleValued, iterator, map, onEmpty, orElse, orElse, peek, transform
-
Methods inherited from interface io.vavr.Value
collect, collect, contains, corresponds, eq, exists, forAll, forEach, getOrElseTry, getOrNull, 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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
INSTANCE
private static final Option.None<?> INSTANCE
The singleton instance of None.
-
-
Method Detail
-
get
public T get()
Description copied from interface:OptionGets the value if this is aSomeor throws if this is aNone.
-
isEmpty
public boolean isEmpty()
Description copied from interface:OptionReturns true, if this isNone, otherwise false, if this isSome.
-
equals
public boolean equals(java.lang.Object o)
Description copied from interface:ValueClarifies that values have a proper equals() method implemented.
-
hashCode
public int hashCode()
Description copied from interface:ValueClarifies that values have a proper hashCode() method implemented.See Object.hashCode().
-
stringPrefix
public java.lang.String stringPrefix()
Description copied from interface:ValueReturns the name of this Value type, which is used by toString().- Specified by:
stringPrefixin interfaceValue<T>- Returns:
- This type name.
-
toString
public java.lang.String toString()
Description copied from interface:ValueClarifies that values have a proper toString() method implemented.See Object.toString().
-
readResolve
private java.lang.Object readResolve()
Instance control for object serialization.- Returns:
- The singleton instance of None.
- See Also:
Serializable
-
-