Uses of Interface
io.vavr.control.Option
Packages that use Option
Package
Description
Beside
API the io.vavr package contains core types like (Checked)Functions and Tuples.Purely functional collections based on Traversable.
This package contains basic building blocks for creating fast, asynchronous, non-blocking parallel code.
A property check framework built around Property which integrates well with unit test frameworks like junit.
-
Uses of Option in io.vavr
Modifier and TypeFieldDescriptionAPI.For1Option.ts1API.For2Option.ts1API.For3Option.ts1API.For4Option.ts1API.For5Option.ts1API.For6Option.ts1API.For7Option.ts1API.For8Option.ts1API.For2Option.ts2API.For3Option.ts2API.For4Option.ts2API.For5Option.ts2API.For6Option.ts2API.For7Option.ts2API.For8Option.ts2API.For3Option.ts3API.For4Option.ts3API.For5Option.ts3API.For6Option.ts3API.For7Option.ts3API.For8Option.ts3API.For4Option.ts4API.For5Option.ts4API.For6Option.ts4API.For7Option.ts4API.For8Option.ts4API.For5Option.ts5API.For6Option.ts5API.For7Option.ts5API.For8Option.ts5API.For6Option.ts6API.For7Option.ts6API.For8Option.ts6API.For7Option.ts7API.For8Option.ts7API.For8Option.ts8Modifier and TypeMethodDescriptionstatic <T, _1 extends Option<Try<T>>>
API.Match.Pattern1<Future<T>, _1> Patterns.$Future(API.Match.Pattern<_1, ?> p1) Modifier and TypeMethodDescriptionfinal <R> Option<R> API.Match.option(API.Match.Case<? extends T, ? extends R>... cases) static <T> Option<T> API.Option(T value) Alias forOption.of(Object)Value.toOption()Converts this to anOption.API.For1Option.yield()A shortcut foryield(Function.identity()).<R> Option<R> Yields a result for elements of the cross product of the underlying Option.<R> Option<R> API.For2Option.yield(BiFunction<? super T1, ? super T2, ? extends R> f) Yields a result for elements of the cross product of the underlying Options.<R> Option<R> Yields a result for elements of the cross product of the underlying Options.<R> Option<R> 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.Modifier and TypeMethodDescriptionCheckedFunction0.lift(CheckedFunction0<? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.CheckedFunction1.lift(CheckedFunction1<? super T1, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.CheckedFunction2.lift(CheckedFunction2<? super T1, ? super T2, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.CheckedFunction3.lift(CheckedFunction3<? super T1, ? super T2, ? super T3, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.CheckedFunction4.lift(CheckedFunction4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.CheckedFunction5.lift(CheckedFunction5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.CheckedFunction6.lift(CheckedFunction6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.CheckedFunction7.lift(CheckedFunction7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.CheckedFunction8.lift(CheckedFunction8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.Lifts the givenpartialFunctioninto a total function that returns anOptionresult.Lifts the givenpartialFunctioninto a total function that returns anOptionresult.Function2.lift(BiFunction<? super T1, ? super T2, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.Lifts the givenpartialFunctioninto a total function that returns anOptionresult.Function4.lift(Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.Function5.lift(Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.Function6.lift(Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.Function7.lift(Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.Function8.lift(Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> partialFunction) Lifts the givenpartialFunctioninto a total function that returns anOptionresult.PartialFunction.lift()Lifts this partial function into a total function that returns anOptionresult.Modifier and TypeMethodDescriptionstatic <T1> API.For1Option<T1> Creates aFor-comprehension of one Option.static <T1,T2> API.For2Option <T1, T2> Creates aFor-comprehension of two Options.static <T1,T2, T3> API.For3Option <T1, T2, T3> Creates aFor-comprehension of three Options.static <T1,T2, T3, T4>
API.For4Option<T1, T2, T3, T4> Creates aFor-comprehension of 4 Options.static <T1,T2, T3, T4, T5>
API.For5Option<T1, T2, T3, T4, T5> 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.Modifier and TypeMethodDescriptionstatic <T,R> PartialFunction <T, R> Unlifts atotalFunctionthat returns anOptionresult into a partial function.ModifierConstructorDescriptionprivateFor1Option(Option<T1> ts1) privateFor2Option(Option<T1> ts1, Option<T2> ts2) privateprivateprivateprivateFor6Option(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4, Option<T5> ts5, Option<T6> ts6) privateFor7Option(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4, Option<T5> ts5, Option<T6> ts6, Option<T7> ts7) privateFor8Option(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 OptionModifier and TypeMethodDescriptionMatches each element with a unique key that you extract from it.Traversable.average()Calculates the average of this elements, assuming that the element type isNumber.AbstractQueue.dequeueOption()Removes an element from this Queue.Finds the value stored in this tree, if exists, by applying the underlying comparator to the tree elements and the given element.Returns the first element of this which satisfies the given predicate.Returns the last element of this which satisfies the given predicate.Returns theSomeof value to which the specified key is mapped, orNoneif this map contains no mapping for the key.Returns theSomeof value to which the specified key is mapped, orNoneif this multimap contains no mapping for the key.HashSet.headOption()LinkedHashSet.headOption()Traversable.headOption()Returns the first element of a non-empty Traversable asOption.TreeSet.headOption()CharSeq.indexOfOption(int ch) Returns the index of the first occurrence of the given element as anOption.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.CharSeq.indexOfOption(CharSeq str) Returns the index of the first occurrence of the given element as anOption.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.Seq.indexOfOption(T element) Returns the index of the first occurrence of the given element as anOptionSeq.indexOfOption(T element, int from) Returns the index of the first occurrence of the given element, after or at some start index as anOptionSeq.indexOfSliceOption(Iterable<? extends T> that) Finds first index where this sequence contains a given sequence as anOptionof a slice.Seq.indexOfSliceOption(Iterable<? extends T> that, int from) Finds first index after or at a start index where this sequence contains a given sequence as anOptionof a slice.Collections.indexOption(int index) Seq.indexWhereOption(Predicate<? super T> predicate) Finds index of first element satisfying some predicate as anOption.Seq.indexWhereOption(Predicate<? super T> predicate, int from) Finds index of the first element satisfying some predicate after or at some start index as anOption.AbstractMultimap.initOption()AbstractQueue.initOption()Dual of AbstractQueue.tailOption(), returning all elements except the last asOption.Array.initOption()BitSet.initOption()CharSeq.initOption()HashMap.initOption()HashSet.initOption()Option<? extends IndexedSeq<T>> IndexedSeq.initOption()Iterator.initOption()LinearSeq.initOption()LinkedHashMap.initOption()LinkedHashSet.initOption()List.initOption()Map.initOption()Maps.initOption(M map) Multimap.initOption()Seq.initOption()Set.initOption()SortedMap.initOption()Option<? extends SortedMultimap<K, V>> SortedMultimap.initOption()SortedSet.initOption()Stream.initOption()default Option<? extends Traversable<T>> Traversable.initOption()Dual of Traversable.tailOption(), returning all elements except the last asOption.Tree.initOption()TreeMap.initOption()TreeSet.initOption()Vector.initOption()CharSeq.lastIndexOfOption(int ch) Returns the index of the last occurrence of the given element as anOption.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.CharSeq.lastIndexOfOption(CharSeq str) Returns the index of the last occurrence of the given element as anOption.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.Seq.lastIndexOfOption(T element) Returns the index of the last occurrence of the given element as anOption.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.Seq.lastIndexOfSliceOption(Iterable<? extends T> that) Finds last index where this sequence contains a given sequence as a slice as anOption.Seq.lastIndexOfSliceOption(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.Seq.lastIndexWhereOption(Predicate<? super T> predicate) Finds index of last element satisfying some predicate as anOption.Seq.lastIndexWhereOption(Predicate<? super T> predicate, int end) Finds index of last element satisfying some predicate before or at given end index as anOption.Traversable.lastOption()Dual of Traversable.headOption(), returning the last element asOption.RedBlackTree.max()Returns the maximum element of this tree according to the underlying comparator.Traversable.max()Calculates the maximum of this elements according to their natural order.Traversable.maxBy(Comparator<? super T> comparator) Calculates the maximum of this elements using a specific comparator.default <U extends Comparable<? super U>>
Option<T> Calculates the maximum of this elements within the co-domain of a specific function.RedBlackTree.min()Returns the minimum element of this tree according to the underlying comparator.Traversable.min()Calculates the minimum of this elements according to their natural order in O(n).Traversable.minBy(Comparator<? super T> comparator) Calculates the minimum of this elements using a specific comparator.default <U extends Comparable<? super U>>
Option<T> Calculates the minimum of this elements within the co-domain of a specific function.AbstractQueue.peekOption()Returns the first element without modifying the Queue.List.peekOption()Returns the head element without modifying the List.List.pop2Option()Removes the head element from this List.List.popOption()Removes the head element from this List.Foldable.reduceLeftOption(BiFunction<? super T, ? super T, ? extends T> op) Accumulates the elements of this Foldable by successively calling the given operationopfrom the left.Traversable.reduceLeftOption(BiFunction<? super T, ? super T, ? extends T> op) Shortcut forisEmpty() ? Option.none() : Option.some(reduceLeft(op)).Foldable.reduceOption(BiFunction<? super T, ? super T, ? extends T> op) Accumulates the elements of this Foldable by successively calling the given operationop.Foldable.reduceRightOption(BiFunction<? super T, ? super T, ? extends T> op) Accumulates the elements of this Foldable by successively calling the given operationopfrom the right.Traversable.reduceRightOption(BiFunction<? super T, ? super T, ? extends T> op) Shortcut forisEmpty() ? Option.none() : Option.some(reduceRight(op)).Traversable.singleOption()Returns the only element of a Traversable asOption.AbstractMultimap.tailOption()AbstractQueue.tailOption()Array.tailOption()BitSet.tailOption()CharSeq.tailOption()HashMap.tailOption()HashSet.tailOption()Option<? extends IndexedSeq<T>> IndexedSeq.tailOption()Iterator.tailOption()LinearSeq.tailOption()LinkedHashMap.tailOption()LinkedHashSet.tailOption()List.tailOption()Map.tailOption()Maps.tailOption(M map) Multimap.tailOption()Seq.tailOption()Set.tailOption()SortedMap.tailOption()Option<? extends SortedMultimap<K, V>> SortedMultimap.tailOption()SortedSet.tailOption()Stream.tailOption()Option<? extends Traversable<T>> Traversable.tailOption()Drops the first element of a non-empty Traversable and returns anOption.Tree.tailOption()TreeMap.tailOption()TreeSet.tailOption()Vector.tailOption()Methods in io.vavr.collection that return types with arguments of type OptionModifier and TypeMethodDescriptionHashMap.computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) LinkedHashMap.computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Map.computeIfPresent(K key, 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.Maps.computeIfPresent(M map, K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) SortedMap.computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) TreeMap.computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Map.lift()Turns this map into a plain function returning an Option result.Seq.lift()Deprecated.Will be removedMethod parameters in io.vavr.collection with type arguments of type OptionModifier and TypeMethodDescriptionstatic <T> Iterator<T> Creates an iterator that repeatedly invokes the supplier while it's aSomeand end on the firstNonestatic <T> Stream<T> Generates a (theoretically) infinitely long Stream using a repeatedly invoked supplier that provides aSomefor each next value and aNonefor the end.static <T> Array<T> Creates an Array from a seed value and a function.static CharSeqCharSeq.unfold(Character seed, Function<? super Character, Option<Tuple2<? extends Character, ? extends Character>>> f) Creates a CharSeq from a seed value and a function.static <T> Iterator<T> Creates an iterator from a seed value and a function.static <T> List<T> Creates a list from a seed value and a function.static <T> Queue<T> Creates a Queue from a seed value and a function.static <T> Stream<T> Creates a Stream from a seed value and a function.static <T> Vector<T> Creates a Vector from a seed value and a function.static <T,U> Array <U> Array.unfoldLeft(T seed, Function<? super T, Option<Tuple2<? extends T, ? extends U>>> f) Creates an Array from a seed value and a function.static <T> CharSeqCharSeq.unfoldLeft(T seed, Function<? super T, Option<Tuple2<? extends T, ? extends Character>>> f) Creates a CharSeq from a seed value and a function.static <T,U> Iterator <U> Iterator.unfoldLeft(T seed, 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, 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, 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, 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, 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, Function<? super T, Option<Tuple2<? extends U, ? extends T>>> f) Creates an Array from a seed value and a function.static <T> CharSeqCharSeq.unfoldRight(T seed, Function<? super T, Option<Tuple2<? extends Character, ? extends T>>> f) Creates a CharSeq from a seed value and a function.static <T,U> Iterator <U> Iterator.unfoldRight(T seed, 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, 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, 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, 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, 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 OptionModifier and TypeFieldDescriptionFutureImpl.valueOnce the Future is completed, the value is defined.Methods in io.vavr.concurrent that return OptionModifier and TypeMethodDescriptionFuture.getCause()Returns the underlying exception of this Future, syntactic sugar forfuture.getValue().map(Try::getCause).Future.getValue()Returns the value of the Future.FutureImpl.getValue()Methods in io.vavr.concurrent that return types with arguments of type OptionModifier and TypeMethodDescriptionReturns aFuturethat eventually succeeds with the first result of the givenFutures which matches the givenpredicate.Future.find(Executor executor, Iterable<? extends Future<? extends T>> futures, Predicate<? super T> predicate) Returns aFuturethat eventually succeeds with the first result of the givenFutures which matches the givenpredicate.Constructors in io.vavr.concurrent with parameters of type Option -
Uses of Option in io.vavr.control
Classes in io.vavr.control that implement OptionModifier and TypeClassDescriptionstatic final classOption.None<T>None is a singleton representation of the undefinedOption.static final classOption.Some<T>Some represents a definedOption.Methods in io.vavr.control that return OptionModifier and TypeMethodDescriptiondefault <R> Option<R> Option.collect(PartialFunction<? super T, ? extends R> partialFunction) Collects value that is in the domain of the givenpartialFunctionby mapping the value to typeR.Filters this right-biasedEitherby testing a predicate.Deprecated.ReturnsSomevalue of type L if this is a left projection of a Left value and the predicate applies to the underlying value.Deprecated.ReturnsSomevalue of type R if this is a right projection of a Right value and the predicate applies to the underlying value.ReturnsSome(value)if this is aSomeand the value satisfies the given predicate.default Option<Validation<E, T>> default <U> Option<U> Maps the value to a newOptionif this is aSome, otherwise returnsNone.default <U> Option<U> Maps the value and wraps it in a newSomeif this is aSome, returnsNone.static <T> Option<T> Narrows a widenedOption<? extends T>toOption<T>by performing a type-safe cast.static <T> Option<T> Option.none()Returns the single instance ofNonestatic <T> Option<T> Option.of(T value) Creates a newOptionof a given value.static <T> Option<T> Option.ofOptional(Optional<? extends T> optional) Wraps a Java Optional to a new OptionRuns a Java Runnable passed as parameter if thisOptionis empty.Returns thisOptionif it is nonempty, otherwise return the alternative.Returns thisOptionif it is nonempty, otherwise return the result of evaluating supplier.Applies an action to this value, if this option is defined, otherwise does nothing.Reduces manyOptions into a singleOptionby transforming anIterable<Option<? extends T>>into aOption<Seq<T>>.static <T> Option<T> Option.some(T value) Creates a newSomeof a given value.Option.traverse(Iterable<? extends T> values, Function<? super T, ? extends Option<? extends U>> mapper) Maps the values of an iterable to a sequence of mapped values into a singleOptionby transforming anIterable<? extends T>into aOption<Seq<U>>.static <T> Option<T> CreatesSomeof suppliers value if condition is true, orNonein other casestatic <T> Option<T> Option.when(boolean condition, T value) CreatesSomeof value if condition is true, orNonein other caseMethods in io.vavr.control with parameters of type OptionModifier and TypeMethodDescriptionstatic <T> Option<T> Narrows a widenedOption<? extends T>toOption<T>by performing a type-safe cast.Returns thisOptionif it is nonempty, otherwise return the alternative.Method parameters in io.vavr.control with type arguments of type OptionModifier and TypeMethodDescriptiondefault <U> Option<U> Maps the value to a newOptionif this is aSome, otherwise returnsNone.Returns thisOptionif it is nonempty, otherwise return the result of evaluating supplier.Reduces manyOptions into a singleOptionby transforming anIterable<Option<? extends T>>into aOption<Seq<T>>.default <U> UTransforms thisOption.Option.traverse(Iterable<? extends T> values, Function<? super T, ? extends Option<? extends U>> mapper) Maps the values of an iterable to a sequence of mapped values into a singleOptionby transforming anIterable<? extends T>into aOption<Seq<U>>. -
Uses of Option in io.vavr.test
Fields in io.vavr.test declared as OptionMethods in io.vavr.test that return OptionModifier and TypeMethodDescriptionCheckResult.Erroneous.error()CheckResult.error()An optional error.CheckResult.Falsified.error()CheckResult.Satisfied.error()CheckResult.Erroneous.sample()CheckResult.Falsified.sample()CheckResult.sample()An optional sample which falsified the property or which lead to an error.CheckResult.Satisfied.sample()Constructors in io.vavr.test with parameters of type Option