Uses of Interface
io.vavr.control.Option
-
Packages that use Option Package Description io.vavr BesideAPI
the io.vavr package contains core types like (Checked)Functions and Tuples.io.vavr.collection Purely functional collections based on Traversable.io.vavr.concurrent This package contains basic building blocks for creating fast, asynchronous, non-blocking parallel code.io.vavr.control io.vavr.test A property check framework built around Property which integrates well with unit test frameworks like junit. -
-
Uses of Option in io.vavr
Fields in io.vavr declared as Option Modifier and Type Field Description private Option<T1>
API.For1Option. ts1
private Option<T1>
API.For2Option. ts1
private Option<T1>
API.For3Option. ts1
private Option<T1>
API.For4Option. ts1
private Option<T1>
API.For5Option. ts1
private Option<T1>
API.For6Option. ts1
private Option<T1>
API.For7Option. ts1
private Option<T1>
API.For8Option. ts1
private Option<T2>
API.For2Option. ts2
private Option<T2>
API.For3Option. ts2
private Option<T2>
API.For4Option. ts2
private Option<T2>
API.For5Option. ts2
private Option<T2>
API.For6Option. ts2
private Option<T2>
API.For7Option. ts2
private Option<T2>
API.For8Option. ts2
private Option<T3>
API.For3Option. ts3
private Option<T3>
API.For4Option. ts3
private Option<T3>
API.For5Option. ts3
private Option<T3>
API.For6Option. ts3
private Option<T3>
API.For7Option. ts3
private Option<T3>
API.For8Option. ts3
private Option<T4>
API.For4Option. ts4
private Option<T4>
API.For5Option. ts4
private Option<T4>
API.For6Option. ts4
private Option<T4>
API.For7Option. ts4
private Option<T4>
API.For8Option. ts4
private Option<T5>
API.For5Option. ts5
private Option<T5>
API.For6Option. ts5
private Option<T5>
API.For7Option. ts5
private Option<T5>
API.For8Option. ts5
private Option<T6>
API.For6Option. ts6
private Option<T6>
API.For7Option. ts6
private Option<T6>
API.For8Option. ts6
private Option<T7>
API.For7Option. ts7
private Option<T7>
API.For8Option. ts7
private Option<T8>
API.For8Option. ts8
Methods in io.vavr with type parameters of type Option Modifier and Type Method Description static <T,_1 extends Option<Try<T>>>
API.Match.Pattern1<Future<T>,_1>Patterns. $Future(API.Match.Pattern<_1,?> p1)
Methods in io.vavr that return Option Modifier and Type Method Description Option<T>
Lazy. filter(java.util.function.Predicate<? super T> predicate)
<R> Option<R>
API.Match. option(API.Match.Case<? extends T,? extends R>... cases)
static <T> Option<T>
API. Option(T value)
Alias forof(Object)
default Option<T>
Value. toOption()
Converts this to anOption
.Option<T1>
API.For1Option. yield()
A shortcut foryield(Function.identity())
.<R> Option<R>
API.For1Option. yield(java.util.function.Function<? super T1,? extends R> f)
Yields a result for elements of the cross product of the underlying Option.<R> Option<R>
API.For2Option. yield(java.util.function.BiFunction<? super T1,? super T2,? extends R> f)
Yields a result for elements of the cross product of the underlying Options.<R> Option<R>
API.For3Option. yield(Function3<? super T1,? super T2,? super T3,? extends R> f)
Yields a result for elements of the cross product of the underlying Options.<R> Option<R>
API.For4Option. yield(Function4<? super T1,? super T2,? super T3,? super T4,? extends R> f)
Yields a result for elements of the cross product of the underlying Options.<R> Option<R>
API.For5Option. yield(Function5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> f)
Yields a result for elements of the cross product of the underlying Options.<R> Option<R>
API.For6Option. yield(Function6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> f)
Yields a result for elements of the cross product of the underlying Options.<R> Option<R>
API.For7Option. yield(Function7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> f)
Yields a result for elements of the cross product of the underlying Options.<R> Option<R>
API.For8Option. yield(Function8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> f)
Yields a result for elements of the cross product of the underlying Options.Methods in io.vavr that return types with arguments of type Option Modifier and Type Method Description (package private) static <T> Tuple1<Option<Try<T>>>
$. Future(Future<T> future)
static <R> Function0<Option<R>>
CheckedFunction0. lift(CheckedFunction0<? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,R>
Function1<T1,Option<R>>CheckedFunction1. lift(CheckedFunction1<? super T1,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,R>
Function2<T1,T2,Option<R>>CheckedFunction2. lift(CheckedFunction2<? super T1,? super T2,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,R>
Function3<T1,T2,T3,Option<R>>CheckedFunction3. lift(CheckedFunction3<? super T1,? super T2,? super T3,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,T4,R>
Function4<T1,T2,T3,T4,Option<R>>CheckedFunction4. lift(CheckedFunction4<? super T1,? super T2,? super T3,? super T4,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,T4,T5,R>
Function5<T1,T2,T3,T4,T5,Option<R>>CheckedFunction5. lift(CheckedFunction5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,T4,T5,T6,R>
Function6<T1,T2,T3,T4,T5,T6,Option<R>>CheckedFunction6. lift(CheckedFunction6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,T4,T5,T6,T7,R>
Function7<T1,T2,T3,T4,T5,T6,T7,Option<R>>CheckedFunction7. lift(CheckedFunction7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,T4,T5,T6,T7,T8,R>
Function8<T1,T2,T3,T4,T5,T6,T7,T8,Option<R>>CheckedFunction8. lift(CheckedFunction8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <R> Function0<Option<R>>
Function0. lift(java.util.function.Supplier<? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,R>
Function1<T1,Option<R>>Function1. lift(java.util.function.Function<? super T1,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,R>
Function2<T1,T2,Option<R>>Function2. lift(java.util.function.BiFunction<? super T1,? super T2,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,R>
Function3<T1,T2,T3,Option<R>>Function3. lift(Function3<? super T1,? super T2,? super T3,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,T4,R>
Function4<T1,T2,T3,T4,Option<R>>Function4. lift(Function4<? super T1,? super T2,? super T3,? super T4,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,T4,T5,R>
Function5<T1,T2,T3,T4,T5,Option<R>>Function5. lift(Function5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,T4,T5,T6,R>
Function6<T1,T2,T3,T4,T5,T6,Option<R>>Function6. lift(Function6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,T4,T5,T6,T7,R>
Function7<T1,T2,T3,T4,T5,T6,T7,Option<R>>Function7. lift(Function7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.static <T1,T2,T3,T4,T5,T6,T7,T8,R>
Function8<T1,T2,T3,T4,T5,T6,T7,T8,Option<R>>Function8. lift(Function8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> partialFunction)
Lifts the givenpartialFunction
into a total function that returns anOption
result.default Function1<T,Option<R>>
PartialFunction. lift()
Lifts this partial function into a total function that returns anOption
result.Methods in io.vavr with parameters of type Option Modifier and Type Method Description static <T1> API.For1Option<T1>
API. For(Option<T1> ts1)
Creates aFor
-comprehension of one Option.static <T1,T2>
API.For2Option<T1,T2>API. For(Option<T1> ts1, Option<T2> ts2)
Creates aFor
-comprehension of two Options.static <T1,T2,T3>
API.For3Option<T1,T2,T3>API. For(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3)
Creates aFor
-comprehension of three Options.static <T1,T2,T3,T4>
API.For4Option<T1,T2,T3,T4>API. For(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4)
Creates aFor
-comprehension of 4 Options.static <T1,T2,T3,T4,T5>
API.For5Option<T1,T2,T3,T4,T5>API. For(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4, Option<T5> ts5)
Creates aFor
-comprehension of 5 Options.static <T1,T2,T3,T4,T5,T6>
API.For6Option<T1,T2,T3,T4,T5,T6>API. For(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4, Option<T5> ts5, Option<T6> ts6)
Creates aFor
-comprehension of 6 Options.static <T1,T2,T3,T4,T5,T6,T7>
API.For7Option<T1,T2,T3,T4,T5,T6,T7>API. For(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4, Option<T5> ts5, Option<T6> ts6, Option<T7> ts7)
Creates aFor
-comprehension of 7 Options.static <T1,T2,T3,T4,T5,T6,T7,T8>
API.For8Option<T1,T2,T3,T4,T5,T6,T7,T8>API. For(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4, Option<T5> ts5, Option<T6> ts6, Option<T7> ts7, Option<T8> ts8)
Creates aFor
-comprehension of 8 Options.Method parameters in io.vavr with type arguments of type Option Modifier and Type Method Description static <T,R>
PartialFunction<T,R>PartialFunction. unlift(java.util.function.Function<? super T,? extends Option<? extends R>> totalFunction)
Unlifts atotalFunction
that returns anOption
result into a partial function.Constructors in io.vavr with parameters of type Option Constructor Description For1Option(Option<T1> ts1)
For2Option(Option<T1> ts1, Option<T2> ts2)
For3Option(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3)
For4Option(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4)
For5Option(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4, Option<T5> ts5)
For6Option(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4, Option<T5> ts5, Option<T6> ts6)
For7Option(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4, Option<T5> ts5, Option<T6> ts6, Option<T7> ts7)
For8Option(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4, Option<T5> ts5, Option<T6> ts6, Option<T7> ts7, Option<T8> ts8)
-
Uses of Option in io.vavr.collection
Methods in io.vavr.collection that return Option Modifier and Type Method Description default <K> Option<Map<K,T>>
Traversable. arrangeBy(java.util.function.Function<? super T,? extends K> getKey)
Matches each element with a unique key that you extract from it.default Option<java.lang.Double>
Traversable. average()
Calculates the average of this elements, assuming that the element type isNumber
.Option<Tuple2<T,Q>>
AbstractQueue. dequeueOption()
Removes an element from this Queue.Option<T>
RedBlackTree. find(T value)
Finds the value stored in this tree, if exists, by applying the underlying comparator to the tree elements and the given element.Option<T>
RedBlackTreeModule.Empty. find(T value)
Option<T>
RedBlackTreeModule.Node. find(T value)
default Option<T>
Traversable. find(java.util.function.Predicate<? super T> predicate)
Returns the first element of this which satisfies the given predicate.default Option<T>
Iterator. findLast(java.util.function.Predicate<? super T> predicate)
default Option<T>
Traversable. findLast(java.util.function.Predicate<? super T> predicate)
Returns the last element of this which satisfies the given predicate.Option<Traversable<V>>
AbstractMultimap. get(K key)
Option<V>
HashArrayMappedTrie. get(K key)
Option<V>
HashArrayMappedTrieModule.AbstractNode. get(K key)
Option<V>
HashMap. get(K key)
Option<V>
LinkedHashMap. get(K key)
Option<V>
Map. get(K key)
Returns theSome
of value to which the specified key is mapped, orNone
if this map contains no mapping for the key.Option<Traversable<V>>
Multimap. get(K key)
Returns theSome
of value to which the specified key is mapped, orNone
if this multimap contains no mapping for the key.Option<V>
TreeMap. get(K key)
Option<T>
HashSet. headOption()
Option<T>
LinkedHashSet. headOption()
default Option<T>
Traversable. headOption()
Returns the first element of a non-empty Traversable asOption
.Option<T>
TreeSet. headOption()
(package private) Option<java.lang.Integer>
CharSeq. indexOfOption(int ch)
Returns the index of the first occurrence of the given element as anOption
.(package private) Option<java.lang.Integer>
CharSeq. indexOfOption(int ch, int fromIndex)
Returns the index of the first occurrence of the given element as anOption
, starting the search at the specified index.Option<java.lang.Integer>
CharSeq. indexOfOption(CharSeq str)
Returns the index of the first occurrence of the given element as anOption
.Option<java.lang.Integer>
CharSeq. indexOfOption(CharSeq str, int fromIndex)
Returns the index of the first occurrence of the given element as anOption
, starting the search at the specified index.default Option<java.lang.Integer>
Seq. indexOfOption(T element)
Returns the index of the first occurrence of the given element as anOption
default Option<java.lang.Integer>
Seq. indexOfOption(T element, int from)
Returns the index of the first occurrence of the given element, after or at some start index as anOption
default Option<java.lang.Integer>
Seq. indexOfSliceOption(java.lang.Iterable<? extends T> that)
Finds first index where this sequence contains a given sequence as anOption
of a slice.default Option<java.lang.Integer>
Seq. indexOfSliceOption(java.lang.Iterable<? extends T> that, int from)
Finds first index after or at a start index where this sequence contains a given sequence as anOption
of a slice.(package private) static Option<java.lang.Integer>
Collections. indexOption(int index)
default Option<java.lang.Integer>
Seq. indexWhereOption(java.util.function.Predicate<? super T> predicate)
Finds index of first element satisfying some predicate as anOption
.default Option<java.lang.Integer>
Seq. indexWhereOption(java.util.function.Predicate<? super T> predicate, int from)
Finds index of the first element satisfying some predicate after or at some start index as anOption
.Option<M>
AbstractMultimap. initOption()
Option<Q>
AbstractQueue. initOption()
Dual of AbstractQueue.tailOption(), returning all elements except the last asOption
.Option<Array<T>>
Array. initOption()
default Option<BitSet<T>>
BitSet. initOption()
Option<CharSeq>
CharSeq. initOption()
Option<HashMap<K,V>>
HashMap. initOption()
Option<HashSet<T>>
HashSet. initOption()
Option<? extends IndexedSeq<T>>
IndexedSeq. initOption()
default Option<Iterator<T>>
Iterator. initOption()
Option<? extends LinearSeq<T>>
LinearSeq. initOption()
Option<LinkedHashMap<K,V>>
LinkedHashMap. initOption()
Option<LinkedHashSet<T>>
LinkedHashSet. initOption()
default Option<List<T>>
List. initOption()
Option<? extends Map<K,V>>
Map. initOption()
(package private) static <K,V,M extends Map<K,V>>
Option<M>Maps. initOption(M map)
Option<? extends Multimap<K,V>>
Multimap. initOption()
Option<? extends Seq<T>>
Seq. initOption()
Option<? extends Set<T>>
Set. initOption()
Option<? extends SortedMap<K,V>>
SortedMap. initOption()
Option<? extends SortedMultimap<K,V>>
SortedMultimap. initOption()
Option<? extends SortedSet<T>>
SortedSet. initOption()
default Option<Stream<T>>
Stream. initOption()
default Option<? extends Traversable<T>>
Traversable. initOption()
Dual of Traversable.tailOption(), returning all elements except the last asOption
.default Option<Seq<T>>
Tree. initOption()
Option<TreeMap<K,V>>
TreeMap. initOption()
Option<TreeSet<T>>
TreeSet. initOption()
Option<Vector<T>>
Vector. initOption()
(package private) Option<java.lang.Integer>
CharSeq. lastIndexOfOption(int ch)
Returns the index of the last occurrence of the given element as anOption
.Option<java.lang.Integer>
CharSeq. lastIndexOfOption(int ch, int fromIndex)
Returns the index of the last occurrence of the given element as anOption
, starting the search at the specified index.Option<java.lang.Integer>
CharSeq. lastIndexOfOption(CharSeq str)
Returns the index of the last occurrence of the given element as anOption
.Option<java.lang.Integer>
CharSeq. lastIndexOfOption(CharSeq str, int fromIndex)
Returns the index of the last occurrence of the given element as anOption
, starting the search at the specified index.default Option<java.lang.Integer>
Seq. lastIndexOfOption(T element)
Returns the index of the last occurrence of the given element as anOption
.default Option<java.lang.Integer>
Seq. lastIndexOfOption(T element, int end)
Returns the index of the last occurrence of the given element before or at a given end index as anOption
.default Option<java.lang.Integer>
Seq. lastIndexOfSliceOption(java.lang.Iterable<? extends T> that)
Finds last index where this sequence contains a given sequence as a slice as anOption
.default Option<java.lang.Integer>
Seq. lastIndexOfSliceOption(java.lang.Iterable<? extends T> that, int end)
Finds last index before or at a given end index where this sequence contains a given sequence as a slice as anOption
.default Option<java.lang.Integer>
Seq. lastIndexWhereOption(java.util.function.Predicate<? super T> predicate)
Finds index of last element satisfying some predicate as anOption
.default Option<java.lang.Integer>
Seq. lastIndexWhereOption(java.util.function.Predicate<? super T> predicate, int end)
Finds index of last element satisfying some predicate before or at given end index as anOption
.default Option<T>
Traversable. lastOption()
Dual of Traversable.headOption(), returning the last element asOption
.(package private) abstract Option<V>
HashArrayMappedTrieModule.AbstractNode. lookup(int shift, int keyHash, K key)
(package private) Option<V>
HashArrayMappedTrieModule.ArrayNode. lookup(int shift, int keyHash, K key)
(package private) Option<V>
HashArrayMappedTrieModule.EmptyNode. lookup(int shift, int keyHash, K key)
(package private) Option<V>
HashArrayMappedTrieModule.IndexedNode. lookup(int shift, int keyHash, K key)
(package private) Option<V>
HashArrayMappedTrieModule.LeafList. lookup(int shift, int keyHash, K key)
(package private) Option<V>
HashArrayMappedTrieModule.LeafSingleton. lookup(int shift, int keyHash, K key)
default Option<T>
RedBlackTree. max()
Returns the maximum element of this tree according to the underlying comparator.default Option<T>
Traversable. max()
Calculates the maximum of this elements according to their natural order.default Option<T>
Traversable. maxBy(java.util.Comparator<? super T> comparator)
Calculates the maximum of this elements using a specific comparator.default <U extends java.lang.Comparable<? super U>>
Option<T>Traversable. maxBy(java.util.function.Function<? super T,? extends U> f)
Calculates the maximum of this elements within the co-domain of a specific function.default Option<T>
RedBlackTree. min()
Returns the minimum element of this tree according to the underlying comparator.default Option<T>
Traversable. min()
Calculates the minimum of this elements according to their natural order in O(n).default Option<T>
Traversable. minBy(java.util.Comparator<? super T> comparator)
Calculates the minimum of this elements using a specific comparator.default <U extends java.lang.Comparable<? super U>>
Option<T>Traversable. minBy(java.util.function.Function<? super T,? extends U> f)
Calculates the minimum of this elements within the co-domain of a specific function.Option<T>
AbstractQueue. peekOption()
Returns the first element without modifying the Queue.default Option<T>
List. peekOption()
Returns the head element without modifying the List.default Option<Tuple2<T,List<T>>>
List. pop2Option()
Removes the head element from this List.default Option<List<T>>
List. popOption()
Removes the head element from this List.Option<T>
Foldable. reduceLeftOption(java.util.function.BiFunction<? super T,? super T,? extends T> op)
Accumulates the elements of this Foldable by successively calling the given operationop
from the left.default Option<T>
Traversable. reduceLeftOption(java.util.function.BiFunction<? super T,? super T,? extends T> op)
Shortcut forisEmpty() ? Option.none() : Option.some(reduceLeft(op))
.default Option<T>
Foldable. reduceOption(java.util.function.BiFunction<? super T,? super T,? extends T> op)
Accumulates the elements of this Foldable by successively calling the given operationop
.Option<T>
Foldable. reduceRightOption(java.util.function.BiFunction<? super T,? super T,? extends T> op)
Accumulates the elements of this Foldable by successively calling the given operationop
from the right.default Option<T>
Traversable. reduceRightOption(java.util.function.BiFunction<? super T,? super T,? extends T> op)
Shortcut forisEmpty() ? Option.none() : Option.some(reduceRight(op))
.default Option<T>
Traversable. singleOption()
Returns the only element of a Traversable asOption
.Option<M>
AbstractMultimap. tailOption()
Option<Q>
AbstractQueue. tailOption()
Option<Array<T>>
Array. tailOption()
default Option<BitSet<T>>
BitSet. tailOption()
Option<CharSeq>
CharSeq. tailOption()
Option<HashMap<K,V>>
HashMap. tailOption()
Option<HashSet<T>>
HashSet. tailOption()
Option<? extends IndexedSeq<T>>
IndexedSeq. tailOption()
default Option<Iterator<T>>
Iterator. tailOption()
Option<? extends LinearSeq<T>>
LinearSeq. tailOption()
Option<LinkedHashMap<K,V>>
LinkedHashMap. tailOption()
Option<LinkedHashSet<T>>
LinkedHashSet. tailOption()
default Option<List<T>>
List. tailOption()
Option<? extends Map<K,V>>
Map. tailOption()
(package private) static <K,V,M extends Map<K,V>>
Option<M>Maps. tailOption(M map)
Option<? extends Multimap<K,V>>
Multimap. tailOption()
Option<? extends Seq<T>>
Seq. tailOption()
Option<? extends Set<T>>
Set. tailOption()
Option<? extends SortedMap<K,V>>
SortedMap. tailOption()
Option<? extends SortedMultimap<K,V>>
SortedMultimap. tailOption()
Option<? extends SortedSet<T>>
SortedSet. tailOption()
default Option<Stream<T>>
Stream. tailOption()
Option<? extends Traversable<T>>
Traversable. tailOption()
Drops the first element of a non-empty Traversable and returns anOption
.default Option<Seq<T>>
Tree. tailOption()
Option<TreeMap<K,V>>
TreeMap. tailOption()
Option<TreeSet<T>>
TreeSet. tailOption()
Option<Vector<T>>
Vector. tailOption()
Methods in io.vavr.collection that return types with arguments of type Option Modifier and Type Method Description Tuple2<Option<V>,HashMap<K,V>>
HashMap. computeIfPresent(K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)
Tuple2<Option<V>,LinkedHashMap<K,V>>
LinkedHashMap. computeIfPresent(K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)
Tuple2<Option<V>,? extends Map<K,V>>
Map. computeIfPresent(K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)
If the value for the specified key is present, attempts to compute a new mapping given the key and its current mapped value.(package private) static <K,V,M extends Map<K,V>>
Tuple2<Option<V>,M>Maps. computeIfPresent(M map, K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)
Tuple2<Option<V>,? extends SortedMap<K,V>>
SortedMap. computeIfPresent(K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)
Tuple2<Option<V>,TreeMap<K,V>>
TreeMap. computeIfPresent(K key, java.util.function.BiFunction<? super K,? super V,? extends V> remappingFunction)
default Function1<K,Option<V>>
Map. lift()
Turns this map into a plain function returning an Option result.default Function1<java.lang.Integer,Option<T>>
Seq. lift()
Deprecated.Will be removedMethod parameters in io.vavr.collection with type arguments of type Option Modifier and Type Method Description static <T> Iterator<T>
Iterator. iterate(java.util.function.Supplier<? extends Option<? extends T>> supplier)
Creates an iterator that repeatedly invokes the supplier while it's aSome
and end on the firstNone
static <T> Stream<T>
Stream. iterate(java.util.function.Supplier<? extends Option<? extends T>> supplier)
Generates a (theoretically) infinitely long Stream using a repeatedly invoked supplier that provides aSome
for each next value and aNone
for the end.static <T> Array<T>
Array. unfold(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends T>>> f)
Creates an Array from a seed value and a function.static CharSeq
CharSeq. unfold(java.lang.Character seed, java.util.function.Function<? super java.lang.Character,Option<Tuple2<? extends java.lang.Character,? extends java.lang.Character>>> f)
Creates a CharSeq from a seed value and a function.static <T> Iterator<T>
Iterator. unfold(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends T>>> f)
Creates an iterator from a seed value and a function.static <T> List<T>
List. unfold(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends T>>> f)
Creates a list from a seed value and a function.static <T> Queue<T>
Queue. unfold(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends T>>> f)
Creates a Queue from a seed value and a function.static <T> Stream<T>
Stream. unfold(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends T>>> f)
Creates a Stream from a seed value and a function.static <T> Vector<T>
Vector. unfold(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends T>>> f)
Creates a Vector from a seed value and a function.static <T,U>
Array<U>Array. unfoldLeft(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends U>>> f)
Creates an Array from a seed value and a function.static <T> CharSeq
CharSeq. unfoldLeft(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends java.lang.Character>>> f)
Creates a CharSeq from a seed value and a function.static <T,U>
Iterator<U>Iterator. unfoldLeft(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends U>>> f)
Creates an iterator from a seed value and a function.static <T,U>
List<U>List. unfoldLeft(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends U>>> f)
Creates a list from a seed value and a function.static <T,U>
Queue<U>Queue. unfoldLeft(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends U>>> f)
Creates a Queue from a seed value and a function.static <T,U>
Stream<U>Stream. unfoldLeft(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends U>>> f)
Creates a Stream from a seed value and a function.static <T,U>
Vector<U>Vector. unfoldLeft(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends T,? extends U>>> f)
Creates a Vector from a seed value and a function.static <T,U>
Array<U>Array. unfoldRight(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends U,? extends T>>> f)
Creates an Array from a seed value and a function.static <T> CharSeq
CharSeq. unfoldRight(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends java.lang.Character,? extends T>>> f)
Creates a CharSeq from a seed value and a function.static <T,U>
Iterator<U>Iterator. unfoldRight(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends U,? extends T>>> f)
Creates an iterator from a seed value and a function.static <T,U>
List<U>List. unfoldRight(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends U,? extends T>>> f)
Creates a list from a seed value and a function.static <T,U>
Queue<U>Queue. unfoldRight(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends U,? extends T>>> f)
Creates a Queue from a seed value and a function.static <T,U>
Stream<U>Stream. unfoldRight(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends U,? extends T>>> f)
Creates a Stream from a seed value and a function.static <T,U>
Vector<U>Vector. unfoldRight(T seed, java.util.function.Function<? super T,Option<Tuple2<? extends U,? extends T>>> f)
Creates a Vector from a seed value and a function. -
Uses of Option in io.vavr.concurrent
Fields in io.vavr.concurrent declared as Option Modifier and Type Field Description private Option<Try<T>>
FutureImpl. value
Once the Future is completed, the value is defined.Methods in io.vavr.concurrent that return Option Modifier and Type Method Description default Option<java.lang.Throwable>
Future. getCause()
Returns the underlying exception of this Future, syntactic sugar forfuture.getValue().map(Try::getCause)
.Option<Try<T>>
Future. getValue()
Returns the value of the Future.Option<Try<T>>
FutureImpl. getValue()
Methods in io.vavr.concurrent that return types with arguments of type Option Modifier and Type Method Description static <T> Future<Option<T>>
Future. find(java.lang.Iterable<? extends Future<? extends T>> futures, java.util.function.Predicate<? super T> predicate)
Returns aFuture
that eventually succeeds with the first result of the givenFuture
s which matches the givenpredicate
.static <T> Future<Option<T>>
Future. find(java.util.concurrent.Executor executor, java.lang.Iterable<? extends Future<? extends T>> futures, java.util.function.Predicate<? super T> predicate)
Returns aFuture
that eventually succeeds with the first result of the givenFuture
s which matches the givenpredicate
.Constructors in io.vavr.concurrent with parameters of type Option Constructor Description FutureImpl(java.util.concurrent.Executor executor, Option<Try<T>> value, Queue<java.util.function.Consumer<Try<T>>> actions, Queue<java.lang.Thread> waiters, FutureImpl.Computation<T> computation)
-
Uses of Option in io.vavr.control
Classes in io.vavr.control that implement Option Modifier and Type Class Description static class
Option.None<T>
None is a singleton representation of the undefinedOption
.static class
Option.Some<T>
Some represents a definedOption
.Methods in io.vavr.control that return Option Modifier and Type Method Description default <R> Option<R>
Option. collect(PartialFunction<? super T,? extends R> partialFunction)
Collects value that is in the domain of the givenpartialFunction
by mapping the value to typeR
.default Option<Either<L,R>>
Either. filter(java.util.function.Predicate<? super R> predicate)
Filters this right-biasedEither
by testing a predicate.Option<Either.LeftProjection<L,R>>
Either.LeftProjection. filter(java.util.function.Predicate<? super L> predicate)
Deprecated.ReturnsSome
value of type L if this is a left projection of a Left value and the predicate applies to the underlying value.Option<Either.RightProjection<L,R>>
Either.RightProjection. filter(java.util.function.Predicate<? super R> predicate)
Deprecated.ReturnsSome
value of type R if this is a right projection of a Right value and the predicate applies to the underlying value.default Option<T>
Option. filter(java.util.function.Predicate<? super T> predicate)
ReturnsSome(value)
if this is aSome
and the value satisfies the given predicate.default Option<Validation<E,T>>
Validation. filter(java.util.function.Predicate<? super T> predicate)
default <U> Option<U>
Option. flatMap(java.util.function.Function<? super T,? extends Option<? extends U>> mapper)
Maps the value to a newOption
if this is aSome
, otherwise returnsNone
.default <U> Option<U>
Option. map(java.util.function.Function<? super T,? extends U> mapper)
Maps the value and wraps it in a newSome
if this is aSome
, returnsNone
.static <T> Option<T>
Option. narrow(Option<? extends T> option)
Narrows a widenedOption<? extends T>
toOption<T>
by performing a type-safe cast.static <T> Option<T>
Option. none()
Returns the single instance ofNone
static <T> Option<T>
Option. of(T value)
Creates a newOption
of a given value.static <T> Option<T>
Option. ofOptional(java.util.Optional<? extends T> optional)
Wraps a Java Optional to a new Optiondefault Option<T>
Option. onEmpty(java.lang.Runnable action)
Runs a Java Runnable passed as parameter if thisOption
is empty.default Option<T>
Option. orElse(Option<? extends T> other)
Returns thisOption
if it is nonempty, otherwise return the alternative.default Option<T>
Option. orElse(java.util.function.Supplier<? extends Option<? extends T>> supplier)
Returns thisOption
if it is nonempty, otherwise return the result of evaluating supplier.default Option<T>
Option. peek(java.util.function.Consumer<? super T> action)
Applies an action to this value, if this option is defined, otherwise does nothing.static <T> Option<Seq<T>>
Option. sequence(java.lang.Iterable<? extends Option<? extends T>> values)
Reduces manyOption
s into a singleOption
by transforming anIterable<Option<? extends T>>
into aOption<Seq<T>>
.static <T> Option<T>
Option. some(T value)
Creates a newSome
of a given value.static <T,U>
Option<Seq<U>>Option. traverse(java.lang.Iterable<? extends T> values, java.util.function.Function<? super T,? extends Option<? extends U>> mapper)
Maps the values of an iterable to a sequence of mapped values into a singleOption
by transforming anIterable<? extends T>
into aOption<Seq<U>>
.static <T> Option<T>
Option. when(boolean condition, java.util.function.Supplier<? extends T> supplier)
CreatesSome
of suppliers value if condition is true, orNone
in other casestatic <T> Option<T>
Option. when(boolean condition, T value)
CreatesSome
of value if condition is true, orNone
in other caseMethods in io.vavr.control with parameters of type Option Modifier and Type Method Description static <T> Option<T>
Option. narrow(Option<? extends T> option)
Narrows a widenedOption<? extends T>
toOption<T>
by performing a type-safe cast.default Option<T>
Option. orElse(Option<? extends T> other)
Returns thisOption
if it is nonempty, otherwise return the alternative.Method parameters in io.vavr.control with type arguments of type Option Modifier and Type Method Description default <U> Option<U>
Option. flatMap(java.util.function.Function<? super T,? extends Option<? extends U>> mapper)
Maps the value to a newOption
if this is aSome
, otherwise returnsNone
.default Option<T>
Option. orElse(java.util.function.Supplier<? extends Option<? extends T>> supplier)
Returns thisOption
if it is nonempty, otherwise return the result of evaluating supplier.static <T> Option<Seq<T>>
Option. sequence(java.lang.Iterable<? extends Option<? extends T>> values)
Reduces manyOption
s into a singleOption
by transforming anIterable<Option<? extends T>>
into aOption<Seq<T>>
.default <U> U
Option. transform(java.util.function.Function<? super Option<T>,? extends U> f)
Transforms thisOption
.static <T,U>
Option<Seq<U>>Option. traverse(java.lang.Iterable<? extends T> values, java.util.function.Function<? super T,? extends Option<? extends U>> mapper)
Maps the values of an iterable to a sequence of mapped values into a singleOption
by transforming anIterable<? extends T>
into aOption<Seq<U>>
. -
Uses of Option in io.vavr.test
Fields in io.vavr.test declared as Option Modifier and Type Field Description private Option<Tuple>
CheckResult.Erroneous. sample
Methods in io.vavr.test that return Option Modifier and Type Method Description Option<java.lang.Error>
CheckResult.Erroneous. error()
Option<java.lang.Error>
CheckResult. error()
An optional error.Option<java.lang.Error>
CheckResult.Falsified. error()
Option<java.lang.Error>
CheckResult.Satisfied. error()
Option<Tuple>
CheckResult.Erroneous. sample()
Option<Tuple>
CheckResult.Falsified. sample()
Option<Tuple>
CheckResult. sample()
An optional sample which falsified the property or which lead to an error.Option<Tuple>
CheckResult.Satisfied. sample()
Constructors in io.vavr.test with parameters of type Option Constructor Description Erroneous(java.lang.String propertyName, int count, java.lang.Error error, Option<Tuple> sample)
-