Package | Description |
---|---|
javaslang | |
javaslang.collection |
Purely functional collections based on Traversable.
|
javaslang.concurrent |
This package contains basic building blocks creating fast, asynchronous, non-blocking parallel code.
|
javaslang.control | |
javaslang.test |
A property check framework built around Property which integrates well with unit test frameworks like junit.
|
Modifier and Type | Method and Description |
---|---|
default Option<T> |
Value.getOption()
Gets the underlying as Option.
|
default Option<T> |
Value.toOption() |
Modifier and Type | Method and Description |
---|---|
static <R> Function0<Option<R>> |
CheckedFunction0.lift(CheckedFunction0<R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,R> Function1<T1,Option<R>> |
CheckedFunction1.lift(CheckedFunction1<T1,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,R> Function2<T1,T2,Option<R>> |
CheckedFunction2.lift(CheckedFunction2<T1,T2,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,R> |
CheckedFunction3.lift(CheckedFunction3<T1,T2,T3,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,T4,R> |
CheckedFunction4.lift(CheckedFunction4<T1,T2,T3,T4,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,T4,T5,R> |
CheckedFunction5.lift(CheckedFunction5<T1,T2,T3,T4,T5,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,T4,T5,T6,R> |
CheckedFunction6.lift(CheckedFunction6<T1,T2,T3,T4,T5,T6,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,T4,T5,T6,T7,R> |
CheckedFunction7.lift(CheckedFunction7<T1,T2,T3,T4,T5,T6,T7,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,T4,T5,T6,T7,T8,R> |
CheckedFunction8.lift(CheckedFunction8<T1,T2,T3,T4,T5,T6,T7,T8,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <R> Function0<Option<R>> |
Function0.lift(Function0<R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,R> Function1<T1,Option<R>> |
Function1.lift(Function1<T1,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,R> Function2<T1,T2,Option<R>> |
Function2.lift(Function2<T1,T2,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,R> |
Function3.lift(Function3<T1,T2,T3,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,T4,R> |
Function4.lift(Function4<T1,T2,T3,T4,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,T4,T5,R> |
Function5.lift(Function5<T1,T2,T3,T4,T5,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,T4,T5,T6,R> |
Function6.lift(Function6<T1,T2,T3,T4,T5,T6,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,T4,T5,T6,T7,R> |
Function7.lift(Function7<T1,T2,T3,T4,T5,T6,T7,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
static <T1,T2,T3,T4,T5,T6,T7,T8,R> |
Function8.lift(Function8<T1,T2,T3,T4,T5,T6,T7,T8,R> partialFunction)
Lifts the given
partialFunction into a total function that returns an Option result. |
Modifier and Type | Method and Description |
---|---|
default Option<Double> |
Traversable.average()
Calculates the average of this elements.
|
Option<Tuple2<T,Queue<T>>> |
Queue.dequeueOption()
Removes an element from this Queue.
|
default Option<T> |
Traversable.findFirst(java.util.function.Predicate<? super T> predicate)
Returns the first element of this which satisfies the given predicate.
|
default Option<T> |
Traversable.findLast(java.util.function.Predicate<? super T> predicate)
Returns the last element of this which satisfies the given predicate.
|
default Option<T> |
Iterator.findLast(java.util.function.Predicate<? super T> predicate) |
Option<V> |
TreeMap.get(K key) |
Option<V> |
Map.get(K key) |
Option<V> |
LinkedHashMap.get(K key) |
Option<V> |
HashMap.get(K key) |
Option<T> |
Vector.headOption() |
Option<T> |
TreeSet.headOption() |
Option<Tuple2<K,V>> |
TreeMap.headOption() |
default Option<T> |
Tree.headOption() |
Option<T> |
Traversable.headOption()
Returns the first element of a non-empty Traversable as
Option . |
default Option<T> |
Stream.headOption() |
Option<T> |
Queue.headOption() |
default Option<T> |
List.headOption() |
Option<T> |
LinkedHashSet.headOption() |
Option<Tuple2<K,V>> |
LinkedHashMap.headOption() |
default Option<T> |
Iterator.headOption() |
Option<T> |
HashSet.headOption() |
Option<Tuple2<K,V>> |
HashMap.headOption() |
Option<Character> |
CharSeq.headOption() |
Option<T> |
Array.headOption() |
Option<? extends Vector<T>> |
Vector.initOption() |
Option<TreeSet<T>> |
TreeSet.initOption() |
Option<TreeMap<K,V>> |
TreeMap.initOption() |
default Option<Seq<T>> |
Tree.initOption() |
Option<? extends Traversable<T>> |
Traversable.initOption()
Dual of Traversable.tailOption(), returning all elements except the last as
Option . |
default Option<Stream<T>> |
Stream.initOption() |
Option<? extends Stack<T>> |
Stack.initOption() |
Option<? extends SortedSet<T>> |
SortedSet.initOption() |
Option<? extends SortedMap<K,V>> |
SortedMap.initOption() |
Option<? extends Set<T>> |
Set.initOption() |
Option<? extends Seq<T>> |
Seq.initOption() |
Option<Queue<T>> |
Queue.initOption() |
Option<? extends Map<K,V>> |
Map.initOption() |
default Option<List<T>> |
List.initOption() |
Option<LinkedHashSet<T>> |
LinkedHashSet.initOption() |
Option<LinkedHashMap<K,V>> |
LinkedHashMap.initOption() |
Option<? extends LinearSeq<T>> |
LinearSeq.initOption() |
default Option<Iterator<T>> |
Iterator.initOption() |
Option<? extends IndexedSeq<T>> |
IndexedSeq.initOption() |
Option<HashSet<T>> |
HashSet.initOption() |
Option<HashMap<K,V>> |
HashMap.initOption() |
Option<CharSeq> |
CharSeq.initOption() |
Option<Array<T>> |
Array.initOption() |
default Option<T> |
Traversable.lastOption()
Dual of Traversable.headOption(), returning the last element as
Opiton . |
Option<T> |
TreeSet.max() |
Option<Tuple2<K,V>> |
TreeMap.max() |
default Option<T> |
Traversable.max()
Calculates the maximum of this elements according to their natural order.
|
default Option<T> |
Traversable.maxBy(Comparator<? super T> comparator)
Calculates the maximum of this elements using a specific comparator.
|
default <U extends Comparable<? super U>> |
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.
|
Option<T> |
TreeSet.min() |
Option<Tuple2<K,V>> |
TreeMap.min() |
default Option<T> |
Traversable.min()
Calculates the minimum of this elements according to their natural order.
|
default Option<T> |
Traversable.minBy(Comparator<? super T> comparator)
Calculates the minimum of this elements using a specific comparator.
|
default <U extends Comparable<? super U>> |
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> |
Stack.peekOption()
Returns the head element without modifying the Stack.
|
Option<T> |
Queue.peekOption()
Returns the first element without modifying the Queue.
|
default Option<T> |
List.peekOption() |
Option<? extends Tuple2<T,? extends Stack<T>>> |
Stack.pop2Option()
Removes the head element from this Stack.
|
default Option<Tuple2<T,List<T>>> |
List.pop2Option() |
Option<? extends Stack<T>> |
Stack.popOption()
Removes the head element from this Stack.
|
default Option<List<T>> |
List.popOption() |
Option<Vector<T>> |
Vector.tailOption() |
Option<TreeSet<T>> |
TreeSet.tailOption() |
Option<TreeMap<K,V>> |
TreeMap.tailOption() |
default Option<Seq<T>> |
Tree.tailOption() |
Option<? extends Traversable<T>> |
Traversable.tailOption()
Drops the first element of a non-empty Traversable and returns an
Option . |
default Option<Stream<T>> |
Stream.tailOption() |
Option<? extends Stack<T>> |
Stack.tailOption() |
Option<? extends SortedSet<T>> |
SortedSet.tailOption() |
Option<? extends SortedMap<K,V>> |
SortedMap.tailOption() |
Option<? extends Set<T>> |
Set.tailOption() |
Option<? extends Seq<T>> |
Seq.tailOption() |
Option<Queue<T>> |
Queue.tailOption() |
Option<? extends Map<K,V>> |
Map.tailOption() |
default Option<List<T>> |
List.tailOption() |
Option<LinkedHashSet<T>> |
LinkedHashSet.tailOption() |
Option<LinkedHashMap<K,V>> |
LinkedHashMap.tailOption() |
Option<? extends LinearSeq<T>> |
LinearSeq.tailOption() |
default Option<Iterator<T>> |
Iterator.tailOption() |
Option<? extends IndexedSeq<T>> |
IndexedSeq.tailOption() |
Option<HashSet<T>> |
HashSet.tailOption() |
Option<HashMap<K,V>> |
HashMap.tailOption() |
Option<CharSeq> |
CharSeq.tailOption() |
Option<Array<T>> |
Array.tailOption() |
Modifier and Type | Method and Description |
---|---|
Option<Try<T>> |
Future.getValue()
Returns the value of the Future.
|
Modifier and Type | Method and Description |
---|---|
static <T> Future<Option<T>> |
Future.find(ExecutorService executorService,
Iterable<? extends Future<? extends T>> futures,
java.util.function.Predicate<? super T> predicate)
Returns a
Future that eventually succeeds with the first result of the given Future s which
matches the given predicate . |
static <T> Future<Option<T>> |
Future.find(Iterable<? extends Future<? extends T>> futures,
java.util.function.Predicate<? super T> predicate)
Returns a
Future that eventually succeeds with the first result of the given Future s which
matches the given predicate . |
Modifier and Type | Class and Description |
---|---|
class |
None<T>
None is a singleton representation of the undefined
Option . |
class |
Some<T>
Some represents a defined
Option . |
Modifier and Type | Method and Description |
---|---|
Option<L> |
Either.LeftProjection.filter(java.util.function.Predicate<? super L> predicate)
Returns
Some value of type L if this is a left projection of a Left value and the predicate
applies to the underlying value. |
Option<R> |
Either.RightProjection.filter(java.util.function.Predicate<? super R> predicate)
Returns
Some 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)
Returns
Some(value) if this is a Some and the value satisfies the given predicate. |
default <U> Option<U> |
Option.flatMap(java.util.function.Function<? super T,? extends Iterable<? extends U>> mapper)
Maps the value to a new
Option if this is a Some , otherwise returns None . |
default Option<T> |
Option.getOption() |
default <U> Option<U> |
Option.map(java.util.function.Function<? super T,? extends U> mapper)
Maps the value and wraps it in a new
Some if this is a Some , returns None . |
static <T> Option<T> |
Option.none()
Returns the single instance of
None |
static <T> Option<T> |
Option.of(T value)
Creates a new
Option of a given value. |
static <T> Option<T> |
Option.ofOptional(Optional<? extends T> optional)
Wraps a Java Optional to a new Option
|
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<T> |
Option.some(T value)
Creates a new
Some of a given value. |
static <T> Option<T> |
Option.when(boolean condition,
java.util.function.Supplier<? extends T> supplier)
Creates
Some of suppliers value if condition is true, or None in other case |
Constructor and Description |
---|
WhenApplicable(T value,
Option<java.util.function.Supplier<? extends R>> result,
Function1<? super U,? extends R> function) |
Modifier and Type | Method and Description |
---|---|
Option<Error> |
CheckResult.error()
An optional error.
|
Option<Tuple> |
CheckResult.sample()
An optional sample which falsified the property or which lead to an error.
|
Option<Tuple> |
CheckResult.Erroneous.sample() |
Copyright © 2015. All Rights Reserved.