Package io.vavr
Class API
- java.lang.Object
-
- io.vavr.API
-
public final class API extends java.lang.Object
The most basic Vavr functionality is accessed through this API class.import static io.vavr.API.*;
For-comprehension
The
For
-comprehension is syntactic sugar for nested for-loops. We write
or// lazily evaluated Iterator<R> result = For(iterable1, iterable2, ..., iterableN).yield(f);
instead ofIterator<R> result = For(iterable1, v1 -> For(iterable2, v2 -> ... For(iterableN).yield(vN -> f.apply(v1, v2, ..., vN)) ) );
Please note that values like Option, Try, Future, etc. are also iterable.for(T1 v1 : iterable1) { for (T2 v2 : iterable2) { ... for (TN vN : iterableN) { R result = f.apply(v1, v2, ..., VN); // // We are forced to perform side effects to do s.th. meaningful with the result. // } } }
Given a suitable function f:
(v1, v2, ..., vN) -> ...
and 1 <= N <= 8 iterables, the result is a Stream of the mapped cross product elements.
As with all Vavr Values, the result of a For-comprehension can be converted to standard Java library and Vavr types.{ f(v1, v2, ..., vN) | v1 ∈ iterable1, ... vN ∈ iterableN }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
API.For1<T1>
For-comprehension with one Iterable.static class
API.For1Either<L,T1>
For-comprehension with one Either.static class
API.For1Future<T1>
For-comprehension with one Future.static class
API.For1List<T1>
For-comprehension with one List.static class
API.For1Option<T1>
For-comprehension with one Option.static class
API.For1Try<T1>
For-comprehension with one Try.static class
API.For2<T1,T2>
For-comprehension with two Iterables.static class
API.For2Either<L,T1,T2>
For-comprehension with two Eithers.static class
API.For2Future<T1,T2>
For-comprehension with two Futures.static class
API.For2List<T1,T2>
For-comprehension with two Lists.static class
API.For2Option<T1,T2>
For-comprehension with two Options.static class
API.For2Try<T1,T2>
For-comprehension with two Trys.static class
API.For3<T1,T2,T3>
For-comprehension with three Iterables.static class
API.For3Either<L,T1,T2,T3>
For-comprehension with three Eithers.static class
API.For3Future<T1,T2,T3>
For-comprehension with three Futures.static class
API.For3List<T1,T2,T3>
For-comprehension with three Lists.static class
API.For3Option<T1,T2,T3>
For-comprehension with three Options.static class
API.For3Try<T1,T2,T3>
For-comprehension with three Trys.static class
API.For4<T1,T2,T3,T4>
For-comprehension with 4 Iterables.static class
API.For4Either<L,T1,T2,T3,T4>
For-comprehension with 4 Eithers.static class
API.For4Future<T1,T2,T3,T4>
For-comprehension with 4 Futures.static class
API.For4List<T1,T2,T3,T4>
For-comprehension with 4 Lists.static class
API.For4Option<T1,T2,T3,T4>
For-comprehension with 4 Options.static class
API.For4Try<T1,T2,T3,T4>
For-comprehension with 4 Trys.static class
API.For5<T1,T2,T3,T4,T5>
For-comprehension with 5 Iterables.static class
API.For5Either<L,T1,T2,T3,T4,T5>
For-comprehension with 5 Eithers.static class
API.For5Future<T1,T2,T3,T4,T5>
For-comprehension with 5 Futures.static class
API.For5List<T1,T2,T3,T4,T5>
For-comprehension with 5 Lists.static class
API.For5Option<T1,T2,T3,T4,T5>
For-comprehension with 5 Options.static class
API.For5Try<T1,T2,T3,T4,T5>
For-comprehension with 5 Trys.static class
API.For6<T1,T2,T3,T4,T5,T6>
For-comprehension with 6 Iterables.static class
API.For6Either<L,T1,T2,T3,T4,T5,T6>
For-comprehension with 6 Eithers.static class
API.For6Future<T1,T2,T3,T4,T5,T6>
For-comprehension with 6 Futures.static class
API.For6List<T1,T2,T3,T4,T5,T6>
For-comprehension with 6 Lists.static class
API.For6Option<T1,T2,T3,T4,T5,T6>
For-comprehension with 6 Options.static class
API.For6Try<T1,T2,T3,T4,T5,T6>
For-comprehension with 6 Trys.static class
API.For7<T1,T2,T3,T4,T5,T6,T7>
For-comprehension with 7 Iterables.static class
API.For7Either<L,T1,T2,T3,T4,T5,T6,T7>
For-comprehension with 7 Eithers.static class
API.For7Future<T1,T2,T3,T4,T5,T6,T7>
For-comprehension with 7 Futures.static class
API.For7List<T1,T2,T3,T4,T5,T6,T7>
For-comprehension with 7 Lists.static class
API.For7Option<T1,T2,T3,T4,T5,T6,T7>
For-comprehension with 7 Options.static class
API.For7Try<T1,T2,T3,T4,T5,T6,T7>
For-comprehension with 7 Trys.static class
API.For8<T1,T2,T3,T4,T5,T6,T7,T8>
For-comprehension with 8 Iterables.static class
API.For8Either<L,T1,T2,T3,T4,T5,T6,T7,T8>
For-comprehension with 8 Eithers.static class
API.For8Future<T1,T2,T3,T4,T5,T6,T7,T8>
For-comprehension with 8 Futures.static class
API.For8List<T1,T2,T3,T4,T5,T6,T7,T8>
For-comprehension with 8 Lists.static class
API.For8Option<T1,T2,T3,T4,T5,T6,T7,T8>
For-comprehension with 8 Options.static class
API.For8Try<T1,T2,T3,T4,T5,T6,T7,T8>
For-comprehension with 8 Trys.static class
API.Match<T>
Scala-like structural pattern matching for Java.
-
Method Summary
Modifier and Type Method Description static <T> API.Match.Pattern0<T>
$()
Wildcard pattern, matches any value.static <T> API.Match.Pattern0<T>
$(java.util.function.Predicate<? super T> predicate)
Guard pattern, checks if a predicate is satisfied.static <T> API.Match.Pattern0<T>
$(T prototype)
Value pattern, checks for equality.static <T> Array<T>
Array()
Alias forArray.empty()
static <T> Array<T>
Array(T element)
Alias forArray.of(Object)
static <T> Array<T>
Array(T... elements)
Alias forArray.of(Object...)
static <T,R>
API.Match.Case<T,R>Case(API.Match.Pattern0<T> pattern, java.util.function.Function<? super T,? extends R> f)
static <T,R>
API.Match.Case<T,R>Case(API.Match.Pattern0<T> pattern, java.util.function.Supplier<? extends R> supplier)
static <T,R>
API.Match.Case<T,R>Case(API.Match.Pattern0<T> pattern, R retVal)
static <T,T1,R>
API.Match.Case<T,R>Case(API.Match.Pattern1<T,T1> pattern, java.util.function.Function<? super T1,? extends R> f)
static <T,T1,R>
API.Match.Case<T,R>Case(API.Match.Pattern1<T,T1> pattern, java.util.function.Supplier<? extends R> supplier)
static <T,T1,R>
API.Match.Case<T,R>Case(API.Match.Pattern1<T,T1> pattern, R retVal)
static <T,T1,T2,R>
API.Match.Case<T,R>Case(API.Match.Pattern2<T,T1,T2> pattern, java.util.function.BiFunction<? super T1,? super T2,? extends R> f)
static <T,T1,T2,R>
API.Match.Case<T,R>Case(API.Match.Pattern2<T,T1,T2> pattern, java.util.function.Supplier<? extends R> supplier)
static <T,T1,T2,R>
API.Match.Case<T,R>Case(API.Match.Pattern2<T,T1,T2> pattern, R retVal)
static <T,T1,T2,T3,R>
API.Match.Case<T,R>Case(API.Match.Pattern3<T,T1,T2,T3> pattern, Function3<? super T1,? super T2,? super T3,? extends R> f)
static <T,T1,T2,T3,R>
API.Match.Case<T,R>Case(API.Match.Pattern3<T,T1,T2,T3> pattern, java.util.function.Supplier<? extends R> supplier)
static <T,T1,T2,T3,R>
API.Match.Case<T,R>Case(API.Match.Pattern3<T,T1,T2,T3> pattern, R retVal)
static <T,T1,T2,T3,T4,R>
API.Match.Case<T,R>Case(API.Match.Pattern4<T,T1,T2,T3,T4> pattern, Function4<? super T1,? super T2,? super T3,? super T4,? extends R> f)
static <T,T1,T2,T3,T4,R>
API.Match.Case<T,R>Case(API.Match.Pattern4<T,T1,T2,T3,T4> pattern, java.util.function.Supplier<? extends R> supplier)
static <T,T1,T2,T3,T4,R>
API.Match.Case<T,R>Case(API.Match.Pattern4<T,T1,T2,T3,T4> pattern, R retVal)
static <T,T1,T2,T3,T4,T5,R>
API.Match.Case<T,R>Case(API.Match.Pattern5<T,T1,T2,T3,T4,T5> pattern, Function5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> f)
static <T,T1,T2,T3,T4,T5,R>
API.Match.Case<T,R>Case(API.Match.Pattern5<T,T1,T2,T3,T4,T5> pattern, java.util.function.Supplier<? extends R> supplier)
static <T,T1,T2,T3,T4,T5,R>
API.Match.Case<T,R>Case(API.Match.Pattern5<T,T1,T2,T3,T4,T5> pattern, R retVal)
static <T,T1,T2,T3,T4,T5,T6,R>
API.Match.Case<T,R>Case(API.Match.Pattern6<T,T1,T2,T3,T4,T5,T6> pattern, Function6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> f)
static <T,T1,T2,T3,T4,T5,T6,R>
API.Match.Case<T,R>Case(API.Match.Pattern6<T,T1,T2,T3,T4,T5,T6> pattern, java.util.function.Supplier<? extends R> supplier)
static <T,T1,T2,T3,T4,T5,T6,R>
API.Match.Case<T,R>Case(API.Match.Pattern6<T,T1,T2,T3,T4,T5,T6> pattern, R retVal)
static <T,T1,T2,T3,T4,T5,T6,T7,R>
API.Match.Case<T,R>Case(API.Match.Pattern7<T,T1,T2,T3,T4,T5,T6,T7> pattern, Function7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> f)
static <T,T1,T2,T3,T4,T5,T6,T7,R>
API.Match.Case<T,R>Case(API.Match.Pattern7<T,T1,T2,T3,T4,T5,T6,T7> pattern, java.util.function.Supplier<? extends R> supplier)
static <T,T1,T2,T3,T4,T5,T6,T7,R>
API.Match.Case<T,R>Case(API.Match.Pattern7<T,T1,T2,T3,T4,T5,T6,T7> pattern, R retVal)
static <T,T1,T2,T3,T4,T5,T6,T7,T8,R>
API.Match.Case<T,R>Case(API.Match.Pattern8<T,T1,T2,T3,T4,T5,T6,T7,T8> pattern, Function8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> f)
static <T,T1,T2,T3,T4,T5,T6,T7,T8,R>
API.Match.Case<T,R>Case(API.Match.Pattern8<T,T1,T2,T3,T4,T5,T6,T7,T8> pattern, java.util.function.Supplier<? extends R> supplier)
static <T,T1,T2,T3,T4,T5,T6,T7,T8,R>
API.Match.Case<T,R>Case(API.Match.Pattern8<T,T1,T2,T3,T4,T5,T6,T7,T8> pattern, R retVal)
static CharSeq
CharSeq(char character)
Alias forCharSeq.of(char)
static CharSeq
CharSeq(char... characters)
Alias forCharSeq.of(char...)
static CharSeq
CharSeq(java.lang.CharSequence sequence)
Alias forCharSeq.of(CharSequence)
static <R> CheckedFunction0<R>
CheckedFunction(CheckedFunction0<R> methodReference)
Alias forCheckedFunction0.of(CheckedFunction0)
static <T1,R>
CheckedFunction1<T1,R>CheckedFunction(CheckedFunction1<T1,R> methodReference)
Alias forCheckedFunction1.of(CheckedFunction1)
static <T1,T2,R>
CheckedFunction2<T1,T2,R>CheckedFunction(CheckedFunction2<T1,T2,R> methodReference)
Alias forCheckedFunction2.of(CheckedFunction2)
static <T1,T2,T3,R>
CheckedFunction3<T1,T2,T3,R>CheckedFunction(CheckedFunction3<T1,T2,T3,R> methodReference)
Alias forCheckedFunction3.of(CheckedFunction3)
static <T1,T2,T3,T4,R>
CheckedFunction4<T1,T2,T3,T4,R>CheckedFunction(CheckedFunction4<T1,T2,T3,T4,R> methodReference)
Alias forCheckedFunction4.of(CheckedFunction4)
static <T1,T2,T3,T4,T5,R>
CheckedFunction5<T1,T2,T3,T4,T5,R>CheckedFunction(CheckedFunction5<T1,T2,T3,T4,T5,R> methodReference)
Alias forCheckedFunction5.of(CheckedFunction5)
static <T1,T2,T3,T4,T5,T6,R>
CheckedFunction6<T1,T2,T3,T4,T5,T6,R>CheckedFunction(CheckedFunction6<T1,T2,T3,T4,T5,T6,R> methodReference)
Alias forCheckedFunction6.of(CheckedFunction6)
static <T1,T2,T3,T4,T5,T6,T7,R>
CheckedFunction7<T1,T2,T3,T4,T5,T6,T7,R>CheckedFunction(CheckedFunction7<T1,T2,T3,T4,T5,T6,T7,R> methodReference)
Alias forCheckedFunction7.of(CheckedFunction7)
static <T1,T2,T3,T4,T5,T6,T7,T8,R>
CheckedFunction8<T1,T2,T3,T4,T5,T6,T7,T8,R>CheckedFunction(CheckedFunction8<T1,T2,T3,T4,T5,T6,T7,T8,R> methodReference)
Alias forCheckedFunction8.of(CheckedFunction8)
static <T> Try<T>
Failure(java.lang.Throwable exception)
Alias forTry.failure(Throwable)
static <T1> API.For1List<T1>
For(List<T1> ts1)
Creates aFor
-comprehension of one List.static <T1,T2>
API.For2List<T1,T2>For(List<T1> ts1, List<T2> ts2)
Creates aFor
-comprehension of two Lists.static <T1,T2,T3>
API.For3List<T1,T2,T3>For(List<T1> ts1, List<T2> ts2, List<T3> ts3)
Creates aFor
-comprehension of three Lists.static <T1,T2,T3,T4>
API.For4List<T1,T2,T3,T4>For(List<T1> ts1, List<T2> ts2, List<T3> ts3, List<T4> ts4)
Creates aFor
-comprehension of 4 Lists.static <T1,T2,T3,T4,T5>
API.For5List<T1,T2,T3,T4,T5>For(List<T1> ts1, List<T2> ts2, List<T3> ts3, List<T4> ts4, List<T5> ts5)
Creates aFor
-comprehension of 5 Lists.static <T1,T2,T3,T4,T5,T6>
API.For6List<T1,T2,T3,T4,T5,T6>For(List<T1> ts1, List<T2> ts2, List<T3> ts3, List<T4> ts4, List<T5> ts5, List<T6> ts6)
Creates aFor
-comprehension of 6 Lists.static <T1,T2,T3,T4,T5,T6,T7>
API.For7List<T1,T2,T3,T4,T5,T6,T7>For(List<T1> ts1, List<T2> ts2, List<T3> ts3, List<T4> ts4, List<T5> ts5, List<T6> ts6, List<T7> ts7)
Creates aFor
-comprehension of 7 Lists.static <T1,T2,T3,T4,T5,T6,T7,T8>
API.For8List<T1,T2,T3,T4,T5,T6,T7,T8>For(List<T1> ts1, List<T2> ts2, List<T3> ts3, List<T4> ts4, List<T5> ts5, List<T6> ts6, List<T7> ts7, List<T8> ts8)
Creates aFor
-comprehension of 8 Lists.static <T1> API.For1Future<T1>
For(Future<T1> ts1)
Creates aFor
-comprehension of one Future.static <T1,T2>
API.For2Future<T1,T2>For(Future<T1> ts1, Future<T2> ts2)
Creates aFor
-comprehension of two Futures.static <T1,T2,T3>
API.For3Future<T1,T2,T3>For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3)
Creates aFor
-comprehension of three Futures.static <T1,T2,T3,T4>
API.For4Future<T1,T2,T3,T4>For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4)
Creates aFor
-comprehension of 4 Futures.static <T1,T2,T3,T4,T5>
API.For5Future<T1,T2,T3,T4,T5>For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5)
Creates aFor
-comprehension of 5 Futures.static <T1,T2,T3,T4,T5,T6>
API.For6Future<T1,T2,T3,T4,T5,T6>For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6)
Creates aFor
-comprehension of 6 Futures.static <T1,T2,T3,T4,T5,T6,T7>
API.For7Future<T1,T2,T3,T4,T5,T6,T7>For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6, Future<T7> ts7)
Creates aFor
-comprehension of 7 Futures.static <T1,T2,T3,T4,T5,T6,T7,T8>
API.For8Future<T1,T2,T3,T4,T5,T6,T7,T8>For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6, Future<T7> ts7, Future<T8> ts8)
Creates aFor
-comprehension of 8 Futures.static <L,T1>
API.For1Either<L,T1>For(Either<L,T1> ts1)
Creates aFor
-comprehension of one Either.static <L,T1,T2>
API.For2Either<L,T1,T2>For(Either<L,T1> ts1, Either<L,T2> ts2)
Creates aFor
-comprehension of two Eithers.static <L,T1,T2,T3>
API.For3Either<L,T1,T2,T3>For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3)
Creates aFor
-comprehension of three Eithers.static <L,T1,T2,T3,T4>
API.For4Either<L,T1,T2,T3,T4>For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3, Either<L,T4> ts4)
Creates aFor
-comprehension of 4 Eithers.static <L,T1,T2,T3,T4,T5>
API.For5Either<L,T1,T2,T3,T4,T5>For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3, Either<L,T4> ts4, Either<L,T5> ts5)
Creates aFor
-comprehension of 5 Eithers.static <L,T1,T2,T3,T4,T5,T6>
API.For6Either<L,T1,T2,T3,T4,T5,T6>For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3, Either<L,T4> ts4, Either<L,T5> ts5, Either<L,T6> ts6)
Creates aFor
-comprehension of 6 Eithers.static <L,T1,T2,T3,T4,T5,T6,T7>
API.For7Either<L,T1,T2,T3,T4,T5,T6,T7>For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3, Either<L,T4> ts4, Either<L,T5> ts5, Either<L,T6> ts6, Either<L,T7> ts7)
Creates aFor
-comprehension of 7 Eithers.static <L,T1,T2,T3,T4,T5,T6,T7,T8>
API.For8Either<L,T1,T2,T3,T4,T5,T6,T7,T8>For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3, Either<L,T4> ts4, Either<L,T5> ts5, Either<L,T6> ts6, Either<L,T7> ts7, Either<L,T8> ts8)
Creates aFor
-comprehension of 8 Eithers.static <T1> API.For1Option<T1>
For(Option<T1> ts1)
Creates aFor
-comprehension of one Option.static <T1,T2>
API.For2Option<T1,T2>For(Option<T1> ts1, Option<T2> ts2)
Creates aFor
-comprehension of two Options.static <T1,T2,T3>
API.For3Option<T1,T2,T3>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>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>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>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>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>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.static <T1> API.For1Try<T1>
For(Try<T1> ts1)
Creates aFor
-comprehension of one Try.static <T1,T2>
API.For2Try<T1,T2>For(Try<T1> ts1, Try<T2> ts2)
Creates aFor
-comprehension of two Trys.static <T1,T2,T3>
API.For3Try<T1,T2,T3>For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3)
Creates aFor
-comprehension of three Trys.static <T1,T2,T3,T4>
API.For4Try<T1,T2,T3,T4>For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3, Try<T4> ts4)
Creates aFor
-comprehension of 4 Trys.static <T1,T2,T3,T4,T5>
API.For5Try<T1,T2,T3,T4,T5>For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3, Try<T4> ts4, Try<T5> ts5)
Creates aFor
-comprehension of 5 Trys.static <T1,T2,T3,T4,T5,T6>
API.For6Try<T1,T2,T3,T4,T5,T6>For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3, Try<T4> ts4, Try<T5> ts5, Try<T6> ts6)
Creates aFor
-comprehension of 6 Trys.static <T1,T2,T3,T4,T5,T6,T7>
API.For7Try<T1,T2,T3,T4,T5,T6,T7>For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3, Try<T4> ts4, Try<T5> ts5, Try<T6> ts6, Try<T7> ts7)
Creates aFor
-comprehension of 7 Trys.static <T1,T2,T3,T4,T5,T6,T7,T8>
API.For8Try<T1,T2,T3,T4,T5,T6,T7,T8>For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3, Try<T4> ts4, Try<T5> ts5, Try<T6> ts6, Try<T7> ts7, Try<T8> ts8)
Creates aFor
-comprehension of 8 Trys.static <T,U>
Iterator<U>For(java.lang.Iterable<T> ts, java.util.function.Function<? super T,? extends java.lang.Iterable<U>> f)
A shortcut forIterator.ofAll(ts).flatMap(f)
which allows us to write real for-comprehensions usingFor(...).yield(...)
.static <T1> API.For1<T1>
For(java.lang.Iterable<T1> ts1)
Creates aFor
-comprehension of one Iterable.static <T1,T2>
API.For2<T1,T2>For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2)
Creates aFor
-comprehension of two Iterables.static <T1,T2,T3>
API.For3<T1,T2,T3>For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3)
Creates aFor
-comprehension of three Iterables.static <T1,T2,T3,T4>
API.For4<T1,T2,T3,T4>For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3, java.lang.Iterable<T4> ts4)
Creates aFor
-comprehension of 4 Iterables.static <T1,T2,T3,T4,T5>
API.For5<T1,T2,T3,T4,T5>For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3, java.lang.Iterable<T4> ts4, java.lang.Iterable<T5> ts5)
Creates aFor
-comprehension of 5 Iterables.static <T1,T2,T3,T4,T5,T6>
API.For6<T1,T2,T3,T4,T5,T6>For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3, java.lang.Iterable<T4> ts4, java.lang.Iterable<T5> ts5, java.lang.Iterable<T6> ts6)
Creates aFor
-comprehension of 6 Iterables.static <T1,T2,T3,T4,T5,T6,T7>
API.For7<T1,T2,T3,T4,T5,T6,T7>For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3, java.lang.Iterable<T4> ts4, java.lang.Iterable<T5> ts5, java.lang.Iterable<T6> ts6, java.lang.Iterable<T7> ts7)
Creates aFor
-comprehension of 7 Iterables.static <T1,T2,T3,T4,T5,T6,T7,T8>
API.For8<T1,T2,T3,T4,T5,T6,T7,T8>For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3, java.lang.Iterable<T4> ts4, java.lang.Iterable<T5> ts5, java.lang.Iterable<T6> ts6, java.lang.Iterable<T7> ts7, java.lang.Iterable<T8> ts8)
Creates aFor
-comprehension of 8 Iterables.static <R> Function0<R>
Function(Function0<R> methodReference)
Alias forFunction0.of(Function0)
static <T1,R>
Function1<T1,R>Function(Function1<T1,R> methodReference)
Alias forFunction1.of(Function1)
static <T1,T2,R>
Function2<T1,T2,R>Function(Function2<T1,T2,R> methodReference)
Alias forFunction2.of(Function2)
static <T1,T2,T3,R>
Function3<T1,T2,T3,R>Function(Function3<T1,T2,T3,R> methodReference)
Alias forFunction3.of(Function3)
static <T1,T2,T3,T4,R>
Function4<T1,T2,T3,T4,R>Function(Function4<T1,T2,T3,T4,R> methodReference)
Alias forFunction4.of(Function4)
static <T1,T2,T3,T4,T5,R>
Function5<T1,T2,T3,T4,T5,R>Function(Function5<T1,T2,T3,T4,T5,R> methodReference)
Alias forFunction5.of(Function5)
static <T1,T2,T3,T4,T5,T6,R>
Function6<T1,T2,T3,T4,T5,T6,R>Function(Function6<T1,T2,T3,T4,T5,T6,R> methodReference)
Alias forFunction6.of(Function6)
static <T1,T2,T3,T4,T5,T6,T7,R>
Function7<T1,T2,T3,T4,T5,T6,T7,R>Function(Function7<T1,T2,T3,T4,T5,T6,T7,R> methodReference)
Alias forFunction7.of(Function7)
static <T1,T2,T3,T4,T5,T6,T7,T8,R>
Function8<T1,T2,T3,T4,T5,T6,T7,T8,R>Function(Function8<T1,T2,T3,T4,T5,T6,T7,T8,R> methodReference)
Alias forFunction8.of(Function8)
static <T> Future<T>
Future(CheckedFunction0<? extends T> computation)
Alias forFuture.of(CheckedFunction0)
static <T> Future<T>
Future(java.util.concurrent.Executor executorService, CheckedFunction0<? extends T> computation)
Alias forFuture.of(Executor, CheckedFunction0)
static <T> Future<T>
Future(java.util.concurrent.Executor executorService, T result)
Alias forFuture.successful(Executor, Object)
static <T> Future<T>
Future(T result)
Alias forFuture.successful(Object)
static <T> IndexedSeq<T>
IndexedSeq()
Alias forVector.empty()
static <T> IndexedSeq<T>
IndexedSeq(T element)
Alias forVector.of(Object)
static <T> IndexedSeq<T>
IndexedSeq(T... elements)
Alias forVector.of(Object...)
static <E,T>
Validation<E,T>Invalid(E error)
Alias forValidation.invalid(Object)
static <T> Lazy<T>
Lazy(java.util.function.Supplier<? extends T> supplier)
Alias forLazy.of(Supplier)
static <L,R>
Either<L,R>Left(L left)
Alias forEither.left(Object)
static <K,V>
Map<K,V>LinkedMap()
Alias forLinkedHashMap.empty()
static <K,V>
Map<K,V>LinkedMap(Tuple2<? extends K,? extends V>... entries)
Deprecated.Will be removed in a future version.static <K,V>
Map<K,V>LinkedMap(K k1, V v1)
Alias forLinkedHashMap.of(Object, Object)
static <K,V>
Map<K,V>LinkedMap(K k1, V v1, K k2, V v2)
static <K,V>
Map<K,V>LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3)
static <K,V>
Map<K,V>LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
static <K,V>
Map<K,V>LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
static <K,V>
Map<K,V>LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
static <K,V>
Map<K,V>LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
static <K,V>
Map<K,V>LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
static <K,V>
Map<K,V>LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
static <K,V>
Map<K,V>LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
static <T> Set<T>
LinkedSet()
Alias forLinkedHashSet.empty()
static <T> Set<T>
LinkedSet(T element)
Alias forLinkedHashSet.of(Object)
static <T> Set<T>
LinkedSet(T... elements)
Alias forLinkedHashSet.of(Object...)
static <T> List<T>
List()
Alias forList.empty()
static <T> List<T>
List(T element)
Alias forList.of(Object)
static <T> List<T>
List(T... elements)
Alias forList.of(Object...)
static <K,V>
Map<K,V>Map()
Alias forHashMap.empty()
static <K,V>
Map<K,V>Map(Tuple2<? extends K,? extends V>... entries)
Deprecated.Will be removed in a future version.static <K,V>
Map<K,V>Map(K k1, V v1)
Alias forHashMap.of(Object, Object)
static <K,V>
Map<K,V>Map(K k1, V v1, K k2, V v2)
static <K,V>
Map<K,V>Map(K k1, V v1, K k2, V v2, K k3, V v3)
static <K,V>
Map<K,V>Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
static <K,V>
Map<K,V>Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
static <K,V>
Map<K,V>Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
static <K,V>
Map<K,V>Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
static <K,V>
Map<K,V>Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
static <K,V>
Map<K,V>Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
static <K,V>
Map<K,V>Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
static <T> API.Match<T>
Match(T value)
Entry point of the match API.static <T> Option<T>
None()
Alias forOption.none()
static <T> Option<T>
Option(T value)
Alias forOption.of(Object)
static void
print(java.lang.Object obj)
Shortcut forSystem.out.print(obj)
.static void
printf(java.lang.String format, java.lang.Object... args)
Shortcut forSystem.out.printf(format, args)
.static void
println()
Shortcut forSystem.out.println()
.static void
println(java.lang.Object obj)
Shortcut forSystem.out.println(obj)
.static void
println(java.lang.Object... objs)
Prints the given objects as space ' ' separated string usingSystem.out.println()
.static <T extends java.lang.Comparable<? super T>>
PriorityQueue<T>PriorityQueue()
Alias forPriorityQueue.empty()
static <T extends java.lang.Comparable<? super T>>
PriorityQueue<T>PriorityQueue(java.util.Comparator<? super T> comparator)
Alias forPriorityQueue.empty(Comparator)
static <T> PriorityQueue<T>
PriorityQueue(java.util.Comparator<? super T> comparator, T element)
Alias forPriorityQueue.of(Comparator, Object)
static <T> PriorityQueue<T>
PriorityQueue(java.util.Comparator<? super T> comparator, T... elements)
Alias forPriorityQueue.of(Comparator, Object...)
static <T extends java.lang.Comparable<? super T>>
PriorityQueue<T>PriorityQueue(T element)
Alias forPriorityQueue.of(Comparable)
static <T extends java.lang.Comparable<? super T>>
PriorityQueue<T>PriorityQueue(T... elements)
Alias forPriorityQueue.of(Comparable...)
static <T> Queue<T>
Queue()
Alias forQueue.empty()
static <T> Queue<T>
Queue(T element)
Alias forQueue.of(Object)
static <T> Queue<T>
Queue(T... elements)
Alias forQueue.of(Object...)
static <L,R>
Either<L,R>Right(R right)
Alias forEither.right(Object)
static java.lang.Void
run(java.lang.Runnable unit)
Runs aunit
of work and returnsVoid
.static <T> Seq<T>
Seq()
Alias forList.empty()
static <T> Seq<T>
Seq(T element)
Alias forList.of(Object)
static <T> Seq<T>
Seq(T... elements)
Alias forList.of(Object...)
static <T> Set<T>
Set()
Alias forHashSet.empty()
static <T> Set<T>
Set(T element)
Alias forHashSet.of(Object)
static <T> Set<T>
Set(T... elements)
Alias forHashSet.of(Object...)
static <T> Option<T>
Some(T value)
Alias forOption.some(Object)
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap()
Alias forTreeMap.empty()
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(Tuple2<? extends K,? extends V>... entries)
Deprecated.Will be removed in a future version.static <K,V>
SortedMap<K,V>SortedMap(java.util.Comparator<? super K> keyComparator)
Alias forTreeMap.empty(Comparator)
static <K,V>
SortedMap<K,V>SortedMap(java.util.Comparator<? super K> keyComparator, Tuple2<? extends K,? extends V>... entries)
Deprecated.Will be removed in a future version.static <K,V>
SortedMap<K,V>SortedMap(java.util.Comparator<? super K> keyComparator, K key, V value)
Alias forTreeMap.of(Comparator, Object, Object)
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(java.util.Map<? extends K,? extends V> map)
Deprecated.Will be removed in a future version.static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(K k1, V v1)
Alias forTreeMap.of(Comparable, Object)
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(K k1, V v1, K k2, V v2)
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(K k1, V v1, K k2, V v2, K k3, V v3)
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
static <K extends java.lang.Comparable<? super K>,V>
SortedMap<K,V>SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
static <T extends java.lang.Comparable<? super T>>
SortedSet<T>SortedSet()
Alias forTreeSet.empty()
static <T extends java.lang.Comparable<? super T>>
SortedSet<T>SortedSet(java.util.Comparator<? super T> comparator)
Alias forTreeSet.empty(Comparator)
static <T> SortedSet<T>
SortedSet(java.util.Comparator<? super T> comparator, T element)
Alias forTreeSet.of(Comparator, Object)
static <T> SortedSet<T>
SortedSet(java.util.Comparator<? super T> comparator, T... elements)
Alias forTreeSet.of(Comparator, Object...)
static <T extends java.lang.Comparable<? super T>>
SortedSet<T>SortedSet(T element)
Alias forTreeSet.of(Comparable)
static <T extends java.lang.Comparable<? super T>>
SortedSet<T>SortedSet(T... elements)
Alias forTreeSet.of(Comparable...)
static <T> Stream<T>
Stream()
Alias forStream.empty()
static <T> Stream<T>
Stream(T element)
Alias forStream.of(Object)
static <T> Stream<T>
Stream(T... elements)
Alias forStream.of(Object...)
static <T> Try<T>
Success(T value)
Alias forTry.success(Object)
static <T> T
TODO()
A temporary replacement for an implementations used during prototyping.static <T> T
TODO(java.lang.String msg)
A temporary replacement for an implementations used during prototyping.static <T> Try<T>
Try(CheckedFunction0<? extends T> supplier)
Alias forTry.of(CheckedFunction0)
static Tuple0
Tuple()
Alias forTuple.empty()
static <T1> Tuple1<T1>
Tuple(T1 t1)
Alias forTuple.of(Object)
Creates a tuple of one element.static <T1,T2>
Tuple2<T1,T2>Tuple(T1 t1, T2 t2)
Alias forTuple.of(Object, Object)
Creates a tuple of two elements.static <T1,T2,T3>
Tuple3<T1,T2,T3>Tuple(T1 t1, T2 t2, T3 t3)
Alias forTuple.of(Object, Object, Object)
Creates a tuple of three elements.static <T1,T2,T3,T4>
Tuple4<T1,T2,T3,T4>Tuple(T1 t1, T2 t2, T3 t3, T4 t4)
Alias forTuple.of(Object, Object, Object, Object)
Creates a tuple of 4 elements.static <T1,T2,T3,T4,T5>
Tuple5<T1,T2,T3,T4,T5>Tuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
Alias forTuple.of(Object, Object, Object, Object, Object)
Creates a tuple of 5 elements.static <T1,T2,T3,T4,T5,T6>
Tuple6<T1,T2,T3,T4,T5,T6>Tuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)
Alias forTuple.of(Object, Object, Object, Object, Object, Object)
Creates a tuple of 6 elements.static <T1,T2,T3,T4,T5,T6,T7>
Tuple7<T1,T2,T3,T4,T5,T6,T7>Tuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7)
Alias forTuple.of(Object, Object, Object, Object, Object, Object, Object)
Creates a tuple of 7 elements.static <T1,T2,T3,T4,T5,T6,T7,T8>
Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>Tuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8)
Alias forTuple.of(Object, Object, Object, Object, Object, Object, Object, Object)
Creates a tuple of 8 elements.static <R> Function0<R>
unchecked(CheckedFunction0<R> f)
Alias forCheckedFunction0.unchecked()
static <T1,R>
Function1<T1,R>unchecked(CheckedFunction1<T1,R> f)
Alias forCheckedFunction1.unchecked()
static <T1,T2,R>
Function2<T1,T2,R>unchecked(CheckedFunction2<T1,T2,R> f)
Alias forCheckedFunction2.unchecked()
static <T1,T2,T3,R>
Function3<T1,T2,T3,R>unchecked(CheckedFunction3<T1,T2,T3,R> f)
Alias forCheckedFunction3.unchecked()
static <T1,T2,T3,T4,R>
Function4<T1,T2,T3,T4,R>unchecked(CheckedFunction4<T1,T2,T3,T4,R> f)
Alias forCheckedFunction4.unchecked()
static <T1,T2,T3,T4,T5,R>
Function5<T1,T2,T3,T4,T5,R>unchecked(CheckedFunction5<T1,T2,T3,T4,T5,R> f)
Alias forCheckedFunction5.unchecked()
static <T1,T2,T3,T4,T5,T6,R>
Function6<T1,T2,T3,T4,T5,T6,R>unchecked(CheckedFunction6<T1,T2,T3,T4,T5,T6,R> f)
Alias forCheckedFunction6.unchecked()
static <T1,T2,T3,T4,T5,T6,T7,R>
Function7<T1,T2,T3,T4,T5,T6,T7,R>unchecked(CheckedFunction7<T1,T2,T3,T4,T5,T6,T7,R> f)
Alias forCheckedFunction7.unchecked()
static <T1,T2,T3,T4,T5,T6,T7,T8,R>
Function8<T1,T2,T3,T4,T5,T6,T7,T8,R>unchecked(CheckedFunction8<T1,T2,T3,T4,T5,T6,T7,T8,R> f)
Alias forCheckedFunction8.unchecked()
static <E,T>
Validation<E,T>Valid(T value)
Alias forValidation.valid(Object)
static <T> Vector<T>
Vector()
Alias forVector.empty()
static <T> Vector<T>
Vector(T element)
Alias forVector.of(Object)
static <T> Vector<T>
Vector(T... elements)
Alias forVector.of(Object...)
-
-
-
Method Detail
-
TODO
public static <T> T TODO()
A temporary replacement for an implementations used during prototyping.Example:
public HttpResponse getResponse(HttpRequest request) { return TODO(); } final HttpResponse response = getHttpResponse(TODO());
- Type Parameters:
T
- The result type of the missing implementation.- Returns:
- Nothing - this methods always throws.
- Throws:
NotImplementedError
- when this methods is called- See Also:
NotImplementedError()
-
TODO
public static <T> T TODO(java.lang.String msg)
A temporary replacement for an implementations used during prototyping.Example:
public HttpResponse getResponse(HttpRequest request) { return TODO("fake response"); } final HttpResponse response = getHttpResponse(TODO("fake request"));
- Type Parameters:
T
- The result type of the missing implementation.- Parameters:
msg
- An error message- Returns:
- Nothing - this methods always throws.
- Throws:
NotImplementedError
- when this methods is called- See Also:
NotImplementedError(String)
-
print
public static void print(java.lang.Object obj)
Shortcut forSystem.out.print(obj)
. SeePrintStream.print(Object)
.- Parameters:
obj
- TheObject
to be printed
-
printf
@GwtIncompatible public static void printf(java.lang.String format, java.lang.Object... args)
Shortcut forSystem.out.printf(format, args)
. SeePrintStream.printf(String, Object...)
.- Parameters:
format
- A format string as described inFormatter
.args
- Arguments referenced by the format specifiers
-
println
public static void println(java.lang.Object obj)
Shortcut forSystem.out.println(obj)
. SeePrintStream.println(Object)
.- Parameters:
obj
- TheObject
to be printed
-
println
public static void println()
Shortcut forSystem.out.println()
. SeePrintStream.println()
.
-
println
public static void println(java.lang.Object... objs)
Prints the given objects as space ' ' separated string usingSystem.out.println()
.- Parameters:
objs
- The objects to be printed
-
Function
public static <R> Function0<R> Function(Function0<R> methodReference)
Alias forFunction0.of(Function0)
- Type Parameters:
R
- return type- Parameters:
methodReference
- A method reference- Returns:
- A
Function0
-
Function
public static <T1,R> Function1<T1,R> Function(Function1<T1,R> methodReference)
Alias forFunction1.of(Function1)
- Type Parameters:
R
- return typeT1
- type of the 1st argument- Parameters:
methodReference
- A method reference- Returns:
- A
Function1
-
Function
public static <T1,T2,R> Function2<T1,T2,R> Function(Function2<T1,T2,R> methodReference)
Alias forFunction2.of(Function2)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argument- Parameters:
methodReference
- A method reference- Returns:
- A
Function2
-
Function
public static <T1,T2,T3,R> Function3<T1,T2,T3,R> Function(Function3<T1,T2,T3,R> methodReference)
Alias forFunction3.of(Function3)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argument- Parameters:
methodReference
- A method reference- Returns:
- A
Function3
-
Function
public static <T1,T2,T3,T4,R> Function4<T1,T2,T3,T4,R> Function(Function4<T1,T2,T3,T4,R> methodReference)
Alias forFunction4.of(Function4)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argument- Parameters:
methodReference
- A method reference- Returns:
- A
Function4
-
Function
public static <T1,T2,T3,T4,T5,R> Function5<T1,T2,T3,T4,T5,R> Function(Function5<T1,T2,T3,T4,T5,R> methodReference)
Alias forFunction5.of(Function5)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argument- Parameters:
methodReference
- A method reference- Returns:
- A
Function5
-
Function
public static <T1,T2,T3,T4,T5,T6,R> Function6<T1,T2,T3,T4,T5,T6,R> Function(Function6<T1,T2,T3,T4,T5,T6,R> methodReference)
Alias forFunction6.of(Function6)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argumentT6
- type of the 6th argument- Parameters:
methodReference
- A method reference- Returns:
- A
Function6
-
Function
public static <T1,T2,T3,T4,T5,T6,T7,R> Function7<T1,T2,T3,T4,T5,T6,T7,R> Function(Function7<T1,T2,T3,T4,T5,T6,T7,R> methodReference)
Alias forFunction7.of(Function7)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argumentT6
- type of the 6th argumentT7
- type of the 7th argument- Parameters:
methodReference
- A method reference- Returns:
- A
Function7
-
Function
public static <T1,T2,T3,T4,T5,T6,T7,T8,R> Function8<T1,T2,T3,T4,T5,T6,T7,T8,R> Function(Function8<T1,T2,T3,T4,T5,T6,T7,T8,R> methodReference)
Alias forFunction8.of(Function8)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argumentT6
- type of the 6th argumentT7
- type of the 7th argumentT8
- type of the 8th argument- Parameters:
methodReference
- A method reference- Returns:
- A
Function8
-
CheckedFunction
public static <R> CheckedFunction0<R> CheckedFunction(CheckedFunction0<R> methodReference)
Alias forCheckedFunction0.of(CheckedFunction0)
- Type Parameters:
R
- return type- Parameters:
methodReference
- A method reference- Returns:
- A
CheckedFunction0
-
CheckedFunction
public static <T1,R> CheckedFunction1<T1,R> CheckedFunction(CheckedFunction1<T1,R> methodReference)
Alias forCheckedFunction1.of(CheckedFunction1)
- Type Parameters:
R
- return typeT1
- type of the 1st argument- Parameters:
methodReference
- A method reference- Returns:
- A
CheckedFunction1
-
CheckedFunction
public static <T1,T2,R> CheckedFunction2<T1,T2,R> CheckedFunction(CheckedFunction2<T1,T2,R> methodReference)
Alias forCheckedFunction2.of(CheckedFunction2)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argument- Parameters:
methodReference
- A method reference- Returns:
- A
CheckedFunction2
-
CheckedFunction
public static <T1,T2,T3,R> CheckedFunction3<T1,T2,T3,R> CheckedFunction(CheckedFunction3<T1,T2,T3,R> methodReference)
Alias forCheckedFunction3.of(CheckedFunction3)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argument- Parameters:
methodReference
- A method reference- Returns:
- A
CheckedFunction3
-
CheckedFunction
public static <T1,T2,T3,T4,R> CheckedFunction4<T1,T2,T3,T4,R> CheckedFunction(CheckedFunction4<T1,T2,T3,T4,R> methodReference)
Alias forCheckedFunction4.of(CheckedFunction4)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argument- Parameters:
methodReference
- A method reference- Returns:
- A
CheckedFunction4
-
CheckedFunction
public static <T1,T2,T3,T4,T5,R> CheckedFunction5<T1,T2,T3,T4,T5,R> CheckedFunction(CheckedFunction5<T1,T2,T3,T4,T5,R> methodReference)
Alias forCheckedFunction5.of(CheckedFunction5)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argument- Parameters:
methodReference
- A method reference- Returns:
- A
CheckedFunction5
-
CheckedFunction
public static <T1,T2,T3,T4,T5,T6,R> CheckedFunction6<T1,T2,T3,T4,T5,T6,R> CheckedFunction(CheckedFunction6<T1,T2,T3,T4,T5,T6,R> methodReference)
Alias forCheckedFunction6.of(CheckedFunction6)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argumentT6
- type of the 6th argument- Parameters:
methodReference
- A method reference- Returns:
- A
CheckedFunction6
-
CheckedFunction
public static <T1,T2,T3,T4,T5,T6,T7,R> CheckedFunction7<T1,T2,T3,T4,T5,T6,T7,R> CheckedFunction(CheckedFunction7<T1,T2,T3,T4,T5,T6,T7,R> methodReference)
Alias forCheckedFunction7.of(CheckedFunction7)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argumentT6
- type of the 6th argumentT7
- type of the 7th argument- Parameters:
methodReference
- A method reference- Returns:
- A
CheckedFunction7
-
CheckedFunction
public static <T1,T2,T3,T4,T5,T6,T7,T8,R> CheckedFunction8<T1,T2,T3,T4,T5,T6,T7,T8,R> CheckedFunction(CheckedFunction8<T1,T2,T3,T4,T5,T6,T7,T8,R> methodReference)
Alias forCheckedFunction8.of(CheckedFunction8)
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argumentT6
- type of the 6th argumentT7
- type of the 7th argumentT8
- type of the 8th argument- Parameters:
methodReference
- A method reference- Returns:
- A
CheckedFunction8
-
unchecked
public static <R> Function0<R> unchecked(CheckedFunction0<R> f)
Alias forCheckedFunction0.unchecked()
- Type Parameters:
R
- return type- Parameters:
f
- A method reference- Returns:
- An unchecked wrapper of supplied
CheckedFunction0
-
unchecked
public static <T1,R> Function1<T1,R> unchecked(CheckedFunction1<T1,R> f)
Alias forCheckedFunction1.unchecked()
- Type Parameters:
R
- return typeT1
- type of the 1st argument- Parameters:
f
- A method reference- Returns:
- An unchecked wrapper of supplied
CheckedFunction1
-
unchecked
public static <T1,T2,R> Function2<T1,T2,R> unchecked(CheckedFunction2<T1,T2,R> f)
Alias forCheckedFunction2.unchecked()
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argument- Parameters:
f
- A method reference- Returns:
- An unchecked wrapper of supplied
CheckedFunction2
-
unchecked
public static <T1,T2,T3,R> Function3<T1,T2,T3,R> unchecked(CheckedFunction3<T1,T2,T3,R> f)
Alias forCheckedFunction3.unchecked()
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argument- Parameters:
f
- A method reference- Returns:
- An unchecked wrapper of supplied
CheckedFunction3
-
unchecked
public static <T1,T2,T3,T4,R> Function4<T1,T2,T3,T4,R> unchecked(CheckedFunction4<T1,T2,T3,T4,R> f)
Alias forCheckedFunction4.unchecked()
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argument- Parameters:
f
- A method reference- Returns:
- An unchecked wrapper of supplied
CheckedFunction4
-
unchecked
public static <T1,T2,T3,T4,T5,R> Function5<T1,T2,T3,T4,T5,R> unchecked(CheckedFunction5<T1,T2,T3,T4,T5,R> f)
Alias forCheckedFunction5.unchecked()
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argument- Parameters:
f
- A method reference- Returns:
- An unchecked wrapper of supplied
CheckedFunction5
-
unchecked
public static <T1,T2,T3,T4,T5,T6,R> Function6<T1,T2,T3,T4,T5,T6,R> unchecked(CheckedFunction6<T1,T2,T3,T4,T5,T6,R> f)
Alias forCheckedFunction6.unchecked()
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argumentT6
- type of the 6th argument- Parameters:
f
- A method reference- Returns:
- An unchecked wrapper of supplied
CheckedFunction6
-
unchecked
public static <T1,T2,T3,T4,T5,T6,T7,R> Function7<T1,T2,T3,T4,T5,T6,T7,R> unchecked(CheckedFunction7<T1,T2,T3,T4,T5,T6,T7,R> f)
Alias forCheckedFunction7.unchecked()
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argumentT6
- type of the 6th argumentT7
- type of the 7th argument- Parameters:
f
- A method reference- Returns:
- An unchecked wrapper of supplied
CheckedFunction7
-
unchecked
public static <T1,T2,T3,T4,T5,T6,T7,T8,R> Function8<T1,T2,T3,T4,T5,T6,T7,T8,R> unchecked(CheckedFunction8<T1,T2,T3,T4,T5,T6,T7,T8,R> f)
Alias forCheckedFunction8.unchecked()
- Type Parameters:
R
- return typeT1
- type of the 1st argumentT2
- type of the 2nd argumentT3
- type of the 3rd argumentT4
- type of the 4th argumentT5
- type of the 5th argumentT6
- type of the 6th argumentT7
- type of the 7th argumentT8
- type of the 8th argument- Parameters:
f
- A method reference- Returns:
- An unchecked wrapper of supplied
CheckedFunction8
-
Tuple
public static Tuple0 Tuple()
Alias forTuple.empty()
- Returns:
- the empty tuple.
-
Tuple
public static <T1> Tuple1<T1> Tuple(T1 t1)
Alias forTuple.of(Object)
Creates a tuple of one element.- Type Parameters:
T1
- type of the 1st element- Parameters:
t1
- the 1st element- Returns:
- a tuple of one element.
-
Tuple
public static <T1,T2> Tuple2<T1,T2> Tuple(T1 t1, T2 t2)
Alias forTuple.of(Object, Object)
Creates a tuple of two elements.- Type Parameters:
T1
- type of the 1st elementT2
- type of the 2nd element- Parameters:
t1
- the 1st elementt2
- the 2nd element- Returns:
- a tuple of two elements.
-
Tuple
public static <T1,T2,T3> Tuple3<T1,T2,T3> Tuple(T1 t1, T2 t2, T3 t3)
Alias forTuple.of(Object, Object, Object)
Creates a tuple of three elements.- Type Parameters:
T1
- type of the 1st elementT2
- type of the 2nd elementT3
- type of the 3rd element- Parameters:
t1
- the 1st elementt2
- the 2nd elementt3
- the 3rd element- Returns:
- a tuple of three elements.
-
Tuple
public static <T1,T2,T3,T4> Tuple4<T1,T2,T3,T4> Tuple(T1 t1, T2 t2, T3 t3, T4 t4)
Alias forTuple.of(Object, Object, Object, Object)
Creates a tuple of 4 elements.- Type Parameters:
T1
- type of the 1st elementT2
- type of the 2nd elementT3
- type of the 3rd elementT4
- type of the 4th element- Parameters:
t1
- the 1st elementt2
- the 2nd elementt3
- the 3rd elementt4
- the 4th element- Returns:
- a tuple of 4 elements.
-
Tuple
public static <T1,T2,T3,T4,T5> Tuple5<T1,T2,T3,T4,T5> Tuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
Alias forTuple.of(Object, Object, Object, Object, Object)
Creates a tuple of 5 elements.- Type Parameters:
T1
- type of the 1st elementT2
- type of the 2nd elementT3
- type of the 3rd elementT4
- type of the 4th elementT5
- type of the 5th element- Parameters:
t1
- the 1st elementt2
- the 2nd elementt3
- the 3rd elementt4
- the 4th elementt5
- the 5th element- Returns:
- a tuple of 5 elements.
-
Tuple
public static <T1,T2,T3,T4,T5,T6> Tuple6<T1,T2,T3,T4,T5,T6> Tuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)
Alias forTuple.of(Object, Object, Object, Object, Object, Object)
Creates a tuple of 6 elements.- Type Parameters:
T1
- type of the 1st elementT2
- type of the 2nd elementT3
- type of the 3rd elementT4
- type of the 4th elementT5
- type of the 5th elementT6
- type of the 6th element- Parameters:
t1
- the 1st elementt2
- the 2nd elementt3
- the 3rd elementt4
- the 4th elementt5
- the 5th elementt6
- the 6th element- Returns:
- a tuple of 6 elements.
-
Tuple
public static <T1,T2,T3,T4,T5,T6,T7> Tuple7<T1,T2,T3,T4,T5,T6,T7> Tuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7)
Alias forTuple.of(Object, Object, Object, Object, Object, Object, Object)
Creates a tuple of 7 elements.- Type Parameters:
T1
- type of the 1st elementT2
- type of the 2nd elementT3
- type of the 3rd elementT4
- type of the 4th elementT5
- type of the 5th elementT6
- type of the 6th elementT7
- type of the 7th element- Parameters:
t1
- the 1st elementt2
- the 2nd elementt3
- the 3rd elementt4
- the 4th elementt5
- the 5th elementt6
- the 6th elementt7
- the 7th element- Returns:
- a tuple of 7 elements.
-
Tuple
public static <T1,T2,T3,T4,T5,T6,T7,T8> Tuple8<T1,T2,T3,T4,T5,T6,T7,T8> Tuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8)
Alias forTuple.of(Object, Object, Object, Object, Object, Object, Object, Object)
Creates a tuple of 8 elements.- Type Parameters:
T1
- type of the 1st elementT2
- type of the 2nd elementT3
- type of the 3rd elementT4
- type of the 4th elementT5
- type of the 5th elementT6
- type of the 6th elementT7
- type of the 7th elementT8
- type of the 8th element- Parameters:
t1
- the 1st elementt2
- the 2nd elementt3
- the 3rd elementt4
- the 4th elementt5
- the 5th elementt6
- the 6th elementt7
- the 7th elementt8
- the 8th element- Returns:
- a tuple of 8 elements.
-
Right
public static <L,R> Either<L,R> Right(R right)
Alias forEither.right(Object)
- Type Parameters:
L
- Type of left value.R
- Type of right value.- Parameters:
right
- The value.- Returns:
- A new
Either
instance.
-
Left
public static <L,R> Either<L,R> Left(L left)
Alias forEither.left(Object)
- Type Parameters:
L
- Type of left value.R
- Type of right value.- Parameters:
left
- The value.- Returns:
- A new
Either
instance.
-
Future
public static <T> Future<T> Future(CheckedFunction0<? extends T> computation)
Alias forFuture.of(CheckedFunction0)
- Type Parameters:
T
- Type of the computation result.- Parameters:
computation
- A computation.- Returns:
- A new
Future
instance. - Throws:
java.lang.NullPointerException
- if computation is null.
-
Future
public static <T> Future<T> Future(java.util.concurrent.Executor executorService, CheckedFunction0<? extends T> computation)
Alias forFuture.of(Executor, CheckedFunction0)
- Type Parameters:
T
- Type of the computation result.- Parameters:
executorService
- An executor service.computation
- A computation.- Returns:
- A new
Future
instance. - Throws:
java.lang.NullPointerException
- if one of executorService or computation is null.
-
Future
public static <T> Future<T> Future(T result)
Alias forFuture.successful(Object)
- Type Parameters:
T
- The value type of a successful result.- Parameters:
result
- The result.- Returns:
- A succeeded
Future
.
-
Future
public static <T> Future<T> Future(java.util.concurrent.Executor executorService, T result)
Alias forFuture.successful(Executor, Object)
- Type Parameters:
T
- The value type of a successful result.- Parameters:
executorService
- AnExecutorService
.result
- The result.- Returns:
- A succeeded
Future
. - Throws:
java.lang.NullPointerException
- if executorService is null
-
Lazy
public static <T> Lazy<T> Lazy(java.util.function.Supplier<? extends T> supplier)
Alias forLazy.of(Supplier)
- Type Parameters:
T
- type of the lazy value- Parameters:
supplier
- A supplier- Returns:
- A new instance of
Lazy
-
Option
public static <T> Option<T> Option(T value)
Alias forOption.of(Object)
- Type Parameters:
T
- type of the value- Parameters:
value
- A value- Returns:
Option.Some
if value is notnull
,Option.None
otherwise
-
Some
public static <T> Option<T> Some(T value)
Alias forOption.some(Object)
- Type Parameters:
T
- type of the value- Parameters:
value
- A value- Returns:
Option
-
None
public static <T> Option<T> None()
Alias forOption.none()
- Type Parameters:
T
- component type- Returns:
- the singleton instance of
Option
-
Try
public static <T> Try<T> Try(CheckedFunction0<? extends T> supplier)
Alias forTry.of(CheckedFunction0)
- Type Parameters:
T
- Component type- Parameters:
supplier
- A checked supplier- Returns:
Try.Success
if no exception occurs, otherwiseTry.Failure
if an exception occurs callingsupplier.get()
.
-
Success
public static <T> Try<T> Success(T value)
Alias forTry.success(Object)
- Type Parameters:
T
- Type of the givenvalue
.- Parameters:
value
- A value.- Returns:
- A new
Try
.
-
Failure
public static <T> Try<T> Failure(java.lang.Throwable exception)
Alias forTry.failure(Throwable)
- Type Parameters:
T
- Component type of theTry
.- Parameters:
exception
- An exception.- Returns:
- A new
Try
.
-
Valid
public static <E,T> Validation<E,T> Valid(T value)
Alias forValidation.valid(Object)
- Type Parameters:
E
- type of the errorT
- type of the givenvalue
- Parameters:
value
- A value- Returns:
Validation
- Throws:
java.lang.NullPointerException
- if value is null
-
Invalid
public static <E,T> Validation<E,T> Invalid(E error)
Alias forValidation.invalid(Object)
- Type Parameters:
E
- type of the givenerror
T
- type of the value- Parameters:
error
- An error- Returns:
Validation
- Throws:
java.lang.NullPointerException
- if error is null
-
CharSeq
public static CharSeq CharSeq(char character)
Alias forCharSeq.of(char)
- Parameters:
character
- A character.- Returns:
- A new
CharSeq
instance containing the given element
-
CharSeq
public static CharSeq CharSeq(char... characters)
Alias forCharSeq.of(char...)
- Parameters:
characters
- Zero or more characters.- Returns:
- A new
CharSeq
instance containing the given characters in the same order. - Throws:
java.lang.NullPointerException
- ifelements
is null
-
CharSeq
public static CharSeq CharSeq(java.lang.CharSequence sequence)
Alias forCharSeq.of(CharSequence)
- Parameters:
sequence
-CharSequence
instance.- Returns:
- A new
CharSeq
instance
-
PriorityQueue
public static <T extends java.lang.Comparable<? super T>> PriorityQueue<T> PriorityQueue()
Alias forPriorityQueue.empty()
- Type Parameters:
T
- Component type of element.- Returns:
- A new
PriorityQueue
empty instance
-
PriorityQueue
public static <T extends java.lang.Comparable<? super T>> PriorityQueue<T> PriorityQueue(java.util.Comparator<? super T> comparator)
Alias forPriorityQueue.empty(Comparator)
- Type Parameters:
T
- Component type of element.- Parameters:
comparator
- The comparator used to sort the elements- Returns:
- A new
PriorityQueue
empty instance
-
PriorityQueue
public static <T extends java.lang.Comparable<? super T>> PriorityQueue<T> PriorityQueue(T element)
Alias forPriorityQueue.of(Comparable)
- Type Parameters:
T
- Component type of element.- Parameters:
element
- An element.- Returns:
- A new
PriorityQueue
instance containing the given element
-
PriorityQueue
public static <T> PriorityQueue<T> PriorityQueue(java.util.Comparator<? super T> comparator, T element)
Alias forPriorityQueue.of(Comparator, Object)
- Type Parameters:
T
- Component type of element.- Parameters:
comparator
- The comparator used to sort the elementselement
- An element.- Returns:
- A new
PriorityQueue
instance containing the given element
-
PriorityQueue
@SafeVarargs public static <T extends java.lang.Comparable<? super T>> PriorityQueue<T> PriorityQueue(T... elements)
Alias forPriorityQueue.of(Comparable...)
- Type Parameters:
T
- Component type of element.- Parameters:
elements
- Zero or more elements.- Returns:
- A new
PriorityQueue
instance containing the given elements
-
PriorityQueue
@SafeVarargs public static <T> PriorityQueue<T> PriorityQueue(java.util.Comparator<? super T> comparator, T... elements)
Alias forPriorityQueue.of(Comparator, Object...)
- Type Parameters:
T
- Component type of element.- Parameters:
comparator
- The comparator used to sort the elementselements
- Zero or more elements.- Returns:
- A new
PriorityQueue
instance containing the given elements
-
Seq
public static <T> Seq<T> Seq()
Alias forList.empty()
- Type Parameters:
T
- Component type of element.- Returns:
- A singleton instance of empty
List
-
Seq
public static <T> Seq<T> Seq(T element)
Alias forList.of(Object)
- Type Parameters:
T
- Component type of element.- Parameters:
element
- An element.- Returns:
- A new
List
instance containing the given element
-
Seq
@SafeVarargs public static <T> Seq<T> Seq(T... elements)
Alias forList.of(Object...)
- Type Parameters:
T
- Component type of elements.- Parameters:
elements
- Zero or more elements.- Returns:
- A new
List
instance containing the given elements - Throws:
java.lang.NullPointerException
- ifelements
is null
-
IndexedSeq
public static <T> IndexedSeq<T> IndexedSeq()
Alias forVector.empty()
- Type Parameters:
T
- Component type of element.- Returns:
- A singleton instance of empty
Vector
-
IndexedSeq
public static <T> IndexedSeq<T> IndexedSeq(T element)
Alias forVector.of(Object)
- Type Parameters:
T
- Component type of element.- Parameters:
element
- An element.- Returns:
- A new
Vector
instance containing the given element
-
IndexedSeq
@SafeVarargs public static <T> IndexedSeq<T> IndexedSeq(T... elements)
Alias forVector.of(Object...)
- Type Parameters:
T
- Component type of elements.- Parameters:
elements
- Zero or more elements.- Returns:
- A new
Vector
instance containing the given elements - Throws:
java.lang.NullPointerException
- ifelements
is null
-
Array
public static <T> Array<T> Array()
Alias forArray.empty()
- Type Parameters:
T
- Component type of element.- Returns:
- A singleton instance of empty
Array
-
Array
public static <T> Array<T> Array(T element)
Alias forArray.of(Object)
- Type Parameters:
T
- Component type of element.- Parameters:
element
- An element.- Returns:
- A new
Array
instance containing the given element
-
Array
@SafeVarargs public static <T> Array<T> Array(T... elements)
Alias forArray.of(Object...)
- Type Parameters:
T
- Component type of elements.- Parameters:
elements
- Zero or more elements.- Returns:
- A new
Array
instance containing the given elements - Throws:
java.lang.NullPointerException
- ifelements
is null
-
List
public static <T> List<T> List()
Alias forList.empty()
- Type Parameters:
T
- Component type of element.- Returns:
- A singleton instance of empty
List
-
List
public static <T> List<T> List(T element)
Alias forList.of(Object)
- Type Parameters:
T
- Component type of element.- Parameters:
element
- An element.- Returns:
- A new
List
instance containing the given element
-
List
@SafeVarargs public static <T> List<T> List(T... elements)
Alias forList.of(Object...)
- Type Parameters:
T
- Component type of elements.- Parameters:
elements
- Zero or more elements.- Returns:
- A new
List
instance containing the given elements - Throws:
java.lang.NullPointerException
- ifelements
is null
-
Queue
public static <T> Queue<T> Queue()
Alias forQueue.empty()
- Type Parameters:
T
- Component type of element.- Returns:
- A singleton instance of empty
Queue
-
Queue
public static <T> Queue<T> Queue(T element)
Alias forQueue.of(Object)
- Type Parameters:
T
- Component type of element.- Parameters:
element
- An element.- Returns:
- A new
Queue
instance containing the given element
-
Queue
@SafeVarargs public static <T> Queue<T> Queue(T... elements)
Alias forQueue.of(Object...)
- Type Parameters:
T
- Component type of elements.- Parameters:
elements
- Zero or more elements.- Returns:
- A new
Queue
instance containing the given elements - Throws:
java.lang.NullPointerException
- ifelements
is null
-
Stream
public static <T> Stream<T> Stream()
Alias forStream.empty()
- Type Parameters:
T
- Component type of element.- Returns:
- A singleton instance of empty
Stream
-
Stream
public static <T> Stream<T> Stream(T element)
Alias forStream.of(Object)
- Type Parameters:
T
- Component type of element.- Parameters:
element
- An element.- Returns:
- A new
Stream
instance containing the given element
-
Stream
@SafeVarargs public static <T> Stream<T> Stream(T... elements)
Alias forStream.of(Object...)
- Type Parameters:
T
- Component type of elements.- Parameters:
elements
- Zero or more elements.- Returns:
- A new
Stream
instance containing the given elements - Throws:
java.lang.NullPointerException
- ifelements
is null
-
Vector
public static <T> Vector<T> Vector()
Alias forVector.empty()
- Type Parameters:
T
- Component type of element.- Returns:
- A singleton instance of empty
Vector
-
Vector
public static <T> Vector<T> Vector(T element)
Alias forVector.of(Object)
- Type Parameters:
T
- Component type of element.- Parameters:
element
- An element.- Returns:
- A new
Vector
instance containing the given element
-
Vector
@SafeVarargs public static <T> Vector<T> Vector(T... elements)
Alias forVector.of(Object...)
- Type Parameters:
T
- Component type of elements.- Parameters:
elements
- Zero or more elements.- Returns:
- A new
Vector
instance containing the given elements - Throws:
java.lang.NullPointerException
- ifelements
is null
-
Set
public static <T> Set<T> Set()
Alias forHashSet.empty()
- Type Parameters:
T
- Component type of element.- Returns:
- A singleton instance of empty
HashSet
-
Set
public static <T> Set<T> Set(T element)
Alias forHashSet.of(Object)
- Type Parameters:
T
- Component type of element.- Parameters:
element
- An element.- Returns:
- A new
HashSet
instance containing the given element
-
Set
@SafeVarargs public static <T> Set<T> Set(T... elements)
Alias forHashSet.of(Object...)
- Type Parameters:
T
- Component type of elements.- Parameters:
elements
- Zero or more elements.- Returns:
- A new
HashSet
instance containing the given elements - Throws:
java.lang.NullPointerException
- ifelements
is null
-
LinkedSet
public static <T> Set<T> LinkedSet()
Alias forLinkedHashSet.empty()
- Type Parameters:
T
- Component type of element.- Returns:
- A singleton instance of empty
LinkedHashSet
-
LinkedSet
public static <T> Set<T> LinkedSet(T element)
Alias forLinkedHashSet.of(Object)
- Type Parameters:
T
- Component type of element.- Parameters:
element
- An element.- Returns:
- A new
LinkedHashSet
instance containing the given element
-
LinkedSet
@SafeVarargs public static <T> Set<T> LinkedSet(T... elements)
Alias forLinkedHashSet.of(Object...)
- Type Parameters:
T
- Component type of elements.- Parameters:
elements
- Zero or more elements.- Returns:
- A new
LinkedHashSet
instance containing the given elements - Throws:
java.lang.NullPointerException
- ifelements
is null
-
SortedSet
public static <T extends java.lang.Comparable<? super T>> SortedSet<T> SortedSet()
Alias forTreeSet.empty()
- Type Parameters:
T
- Component type of element.- Returns:
- A new
TreeSet
empty instance
-
SortedSet
public static <T extends java.lang.Comparable<? super T>> SortedSet<T> SortedSet(java.util.Comparator<? super T> comparator)
Alias forTreeSet.empty(Comparator)
- Type Parameters:
T
- Component type of element.- Parameters:
comparator
- The comparator used to sort the elements- Returns:
- A new
TreeSet
empty instance
-
SortedSet
public static <T extends java.lang.Comparable<? super T>> SortedSet<T> SortedSet(T element)
Alias forTreeSet.of(Comparable)
- Type Parameters:
T
- Component type of element.- Parameters:
element
- An element.- Returns:
- A new
TreeSet
instance containing the given element
-
SortedSet
public static <T> SortedSet<T> SortedSet(java.util.Comparator<? super T> comparator, T element)
Alias forTreeSet.of(Comparator, Object)
- Type Parameters:
T
- Component type of element.- Parameters:
comparator
- The comparator used to sort the elementselement
- An element.- Returns:
- A new
TreeSet
instance containing the given element
-
SortedSet
@SafeVarargs public static <T extends java.lang.Comparable<? super T>> SortedSet<T> SortedSet(T... elements)
Alias forTreeSet.of(Comparable...)
- Type Parameters:
T
- Component type of element.- Parameters:
elements
- Zero or more elements.- Returns:
- A new
TreeSet
instance containing the given elements
-
SortedSet
@SafeVarargs public static <T> SortedSet<T> SortedSet(java.util.Comparator<? super T> comparator, T... elements)
Alias forTreeSet.of(Comparator, Object...)
- Type Parameters:
T
- Component type of element.- Parameters:
comparator
- The comparator used to sort the elementselements
- Zero or more elements.- Returns:
- A new
TreeSet
instance containing the given elements
-
Map
public static <K,V> Map<K,V> Map()
Alias forHashMap.empty()
- Type Parameters:
K
- The key type.V
- The value type.- Returns:
- A singleton instance of empty
HashMap
-
Map
@Deprecated @SafeVarargs public static <K,V> Map<K,V> Map(Tuple2<? extends K,? extends V>... entries)
Deprecated.Will be removed in a future version.Alias forHashMap.ofEntries(Tuple2...)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
entries
- Map entries.- Returns:
- A new
HashMap
instance containing the given entries
-
Map
public static <K,V> Map<K,V> Map(K k1, V v1)
Alias forHashMap.of(Object, Object)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The keyv1
- The value- Returns:
- A new
HashMap
instance containing the given entries
-
Map
public static <K,V> Map<K,V> Map(K k1, V v1, K k2, V v2)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pair- Returns:
- A new
HashMap
instance containing the given entries
-
Map
public static <K,V> Map<K,V> Map(K k1, V v1, K k2, V v2, K k3, V v3)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pair- Returns:
- A new
HashMap
instance containing the given entries
-
Map
public static <K,V> Map<K,V> Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pair- Returns:
- A new
HashMap
instance containing the given entries
-
Map
public static <K,V> Map<K,V> Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
Alias forHashMap.of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pair- Returns:
- A new
HashMap
instance containing the given entries
-
Map
public static <K,V> Map<K,V> Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pair- Returns:
- A new
HashMap
instance containing the given entries
-
Map
public static <K,V> Map<K,V> Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pair- Returns:
- A new
HashMap
instance containing the given entries
-
Map
public static <K,V> Map<K,V> Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pairk8
- The key of the 8th pairv8
- The value of the 8th pair- Returns:
- A new
HashMap
instance containing the given entries
-
Map
public static <K,V> Map<K,V> Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pairk8
- The key of the 8th pairv8
- The value of the 8th pairk9
- The key of the 9th pairv9
- The value of the 9th pair- Returns:
- A new
HashMap
instance containing the given entries
-
Map
public static <K,V> Map<K,V> Map(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pairk8
- The key of the 8th pairv8
- The value of the 8th pairk9
- The key of the 9th pairv9
- The value of the 9th pairk10
- The key of the 10th pairv10
- The value of the 10th pair- Returns:
- A new
HashMap
instance containing the given entries
-
LinkedMap
public static <K,V> Map<K,V> LinkedMap()
Alias forLinkedHashMap.empty()
- Type Parameters:
K
- The key type.V
- The value type.- Returns:
- A singleton instance of empty
LinkedHashMap
-
LinkedMap
@Deprecated @SafeVarargs public static <K,V> Map<K,V> LinkedMap(Tuple2<? extends K,? extends V>... entries)
Deprecated.Will be removed in a future version.Alias forLinkedHashMap.ofEntries(Tuple2...)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
entries
- Map entries.- Returns:
- A new
LinkedHashMap
instance containing the given entries
-
LinkedMap
public static <K,V> Map<K,V> LinkedMap(K k1, V v1)
Alias forLinkedHashMap.of(Object, Object)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The keyv1
- The value- Returns:
- A new
LinkedHashMap
instance containing the given entries
-
LinkedMap
public static <K,V> Map<K,V> LinkedMap(K k1, V v1, K k2, V v2)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pair- Returns:
- A new
LinkedHashMap
instance containing the given entries
-
LinkedMap
public static <K,V> Map<K,V> LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pair- Returns:
- A new
LinkedHashMap
instance containing the given entries
-
LinkedMap
public static <K,V> Map<K,V> LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pair- Returns:
- A new
LinkedHashMap
instance containing the given entries
-
LinkedMap
public static <K,V> Map<K,V> LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
Alias forLinkedHashMap.of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pair- Returns:
- A new
LinkedHashMap
instance containing the given entries
-
LinkedMap
public static <K,V> Map<K,V> LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pair- Returns:
- A new
LinkedHashMap
instance containing the given entries
-
LinkedMap
public static <K,V> Map<K,V> LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pair- Returns:
- A new
LinkedHashMap
instance containing the given entries
-
LinkedMap
public static <K,V> Map<K,V> LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pairk8
- The key of the 8th pairv8
- The value of the 8th pair- Returns:
- A new
LinkedHashMap
instance containing the given entries
-
LinkedMap
public static <K,V> Map<K,V> LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pairk8
- The key of the 8th pairv8
- The value of the 8th pairk9
- The key of the 9th pairv9
- The value of the 9th pair- Returns:
- A new
LinkedHashMap
instance containing the given entries
-
LinkedMap
public static <K,V> Map<K,V> LinkedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pairk8
- The key of the 8th pairv8
- The value of the 8th pairk9
- The key of the 9th pairv9
- The value of the 9th pairk10
- The key of the 10th pairv10
- The value of the 10th pair- Returns:
- A new
LinkedHashMap
instance containing the given entries
-
SortedMap
public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap()
Alias forTreeMap.empty()
- Type Parameters:
K
- The key type.V
- The value type.- Returns:
- A new empty
TreeMap
instance
-
SortedMap
public static <K,V> SortedMap<K,V> SortedMap(java.util.Comparator<? super K> keyComparator)
Alias forTreeMap.empty(Comparator)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
keyComparator
- The comparator used to sort the entries by their key- Returns:
- A new empty
TreeMap
instance
-
SortedMap
public static <K,V> SortedMap<K,V> SortedMap(java.util.Comparator<? super K> keyComparator, K key, V value)
Alias forTreeMap.of(Comparator, Object, Object)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
keyComparator
- The comparator used to sort the entries by their keykey
- A singleton map key.value
- A singleton map value.- Returns:
- A new
TreeMap
instance containing the given entry
-
SortedMap
@Deprecated @SafeVarargs public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(Tuple2<? extends K,? extends V>... entries)
Deprecated.Will be removed in a future version.Alias forTreeMap.ofEntries(Tuple2...)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
entries
- Map entries.- Returns:
- A new
TreeMap
instance containing the given entries
-
SortedMap
@Deprecated @SafeVarargs public static <K,V> SortedMap<K,V> SortedMap(java.util.Comparator<? super K> keyComparator, Tuple2<? extends K,? extends V>... entries)
Deprecated.Will be removed in a future version.Alias forTreeMap.ofEntries(Comparator, Tuple2...)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
keyComparator
- The comparator used to sort the entries by their keyentries
- Map entries.- Returns:
- A new
TreeMap
instance containing the given entry
-
SortedMap
@Deprecated public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(java.util.Map<? extends K,? extends V> map)
Deprecated.Will be removed in a future version.Alias forTreeMap.ofAll(java.util.Map)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
map
- A map entry.- Returns:
- A new
TreeMap
instance containing the given map
-
SortedMap
public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(K k1, V v1)
Alias forTreeMap.of(Comparable, Object)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The keyv1
- The value- Returns:
- A new
TreeMap
instance containing the given entries
-
SortedMap
public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(K k1, V v1, K k2, V v2)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pair- Returns:
- A new
TreeMap
instance containing the given entries
-
SortedMap
public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(K k1, V v1, K k2, V v2, K k3, V v3)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pair- Returns:
- A new
TreeMap
instance containing the given entries
-
SortedMap
public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
Alias forTreeMap.of(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pair- Returns:
- A new
TreeMap
instance containing the given entries
-
SortedMap
public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pair- Returns:
- A new
TreeMap
instance containing the given entries
-
SortedMap
public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pair- Returns:
- A new
TreeMap
instance containing the given entries
-
SortedMap
public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pair- Returns:
- A new
TreeMap
instance containing the given entries
-
SortedMap
public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pairk8
- The key of the 8th pairv8
- The value of the 8th pair- Returns:
- A new
TreeMap
instance containing the given entries
-
SortedMap
public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pairk8
- The key of the 8th pairv8
- The value of the 8th pairk9
- The key of the 9th pairv9
- The value of the 9th pair- Returns:
- A new
TreeMap
instance containing the given entries
-
SortedMap
public static <K extends java.lang.Comparable<? super K>,V> SortedMap<K,V> SortedMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
k1
- The key of the 1st pairv1
- The value of the 1st pairk2
- The key of the 2nd pairv2
- The value of the 2nd pairk3
- The key of the 3rd pairv3
- The value of the 3rd pairk4
- The key of the 4th pairv4
- The value of the 4th pairk5
- The key of the 5th pairv5
- The value of the 5th pairk6
- The key of the 6th pairv6
- The value of the 6th pairk7
- The key of the 7th pairv7
- The value of the 7th pairk8
- The key of the 8th pairv8
- The value of the 8th pairk9
- The key of the 9th pairv9
- The value of the 9th pairk10
- The key of the 10th pairv10
- The value of the 10th pair- Returns:
- A new
TreeMap
instance containing the given entries
-
run
public static java.lang.Void run(java.lang.Runnable unit)
Runs aunit
of work and returnsVoid
. This is helpful when a return value is expected, e.g. byMatch
:Match(i).of( Case($(is(0)), i -> run(() -> System.out.println("zero"))), Case($(is(1)), i -> run(() -> System.out.println("one"))), Case($(), o -> run(() -> System.out.println("many"))) )
- Parameters:
unit
- A block of code to be run.- Returns:
- the single instance of
Void
, namelynull
-
For
public static <T,U> Iterator<U> For(java.lang.Iterable<T> ts, java.util.function.Function<? super T,? extends java.lang.Iterable<U>> f)
A shortcut forIterator.ofAll(ts).flatMap(f)
which allows us to write real for-comprehensions usingFor(...).yield(...)
.Example:
For(getPersons(), person -> For(person.getTweets(), tweet -> For(tweet.getReplies()) .yield(reply -> person + ", " + tweet + ", " + reply)));
- Type Parameters:
T
- element type ofts
U
- component type of the resultingIterator
- Parameters:
ts
- AIterable
f
- A functionT -> Iterable<U>
- Returns:
- A new Iterator
-
For
public static <T1> API.For1<T1> For(java.lang.Iterable<T1> ts1)
Creates aFor
-comprehension of one Iterable.- Type Parameters:
T1
- right component type of the 1st Iterable- Parameters:
ts1
- the 1st Iterable- Returns:
- a new
For
-comprehension of arity 1
-
For
public static <T1,T2> API.For2<T1,T2> For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2)
Creates aFor
-comprehension of two Iterables.- Type Parameters:
T1
- right component type of the 1st IterableT2
- right component type of the 2nd Iterable- Parameters:
ts1
- the 1st Iterablets2
- the 2nd Iterable- Returns:
- a new
For
-comprehension of arity 2
-
For
public static <T1,T2,T3> API.For3<T1,T2,T3> For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3)
Creates aFor
-comprehension of three Iterables.- Type Parameters:
T1
- right component type of the 1st IterableT2
- right component type of the 2nd IterableT3
- right component type of the 3rd Iterable- Parameters:
ts1
- the 1st Iterablets2
- the 2nd Iterablets3
- the 3rd Iterable- Returns:
- a new
For
-comprehension of arity 3
-
For
public static <T1,T2,T3,T4> API.For4<T1,T2,T3,T4> For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3, java.lang.Iterable<T4> ts4)
Creates aFor
-comprehension of 4 Iterables.- Type Parameters:
T1
- right component type of the 1st IterableT2
- right component type of the 2nd IterableT3
- right component type of the 3rd IterableT4
- right component type of the 4th Iterable- Parameters:
ts1
- the 1st Iterablets2
- the 2nd Iterablets3
- the 3rd Iterablets4
- the 4th Iterable- Returns:
- a new
For
-comprehension of arity 4
-
For
public static <T1,T2,T3,T4,T5> API.For5<T1,T2,T3,T4,T5> For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3, java.lang.Iterable<T4> ts4, java.lang.Iterable<T5> ts5)
Creates aFor
-comprehension of 5 Iterables.- Type Parameters:
T1
- right component type of the 1st IterableT2
- right component type of the 2nd IterableT3
- right component type of the 3rd IterableT4
- right component type of the 4th IterableT5
- right component type of the 5th Iterable- Parameters:
ts1
- the 1st Iterablets2
- the 2nd Iterablets3
- the 3rd Iterablets4
- the 4th Iterablets5
- the 5th Iterable- Returns:
- a new
For
-comprehension of arity 5
-
For
public static <T1,T2,T3,T4,T5,T6> API.For6<T1,T2,T3,T4,T5,T6> For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3, java.lang.Iterable<T4> ts4, java.lang.Iterable<T5> ts5, java.lang.Iterable<T6> ts6)
Creates aFor
-comprehension of 6 Iterables.- Type Parameters:
T1
- right component type of the 1st IterableT2
- right component type of the 2nd IterableT3
- right component type of the 3rd IterableT4
- right component type of the 4th IterableT5
- right component type of the 5th IterableT6
- right component type of the 6th Iterable- Parameters:
ts1
- the 1st Iterablets2
- the 2nd Iterablets3
- the 3rd Iterablets4
- the 4th Iterablets5
- the 5th Iterablets6
- the 6th Iterable- Returns:
- a new
For
-comprehension of arity 6
-
For
public static <T1,T2,T3,T4,T5,T6,T7> API.For7<T1,T2,T3,T4,T5,T6,T7> For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3, java.lang.Iterable<T4> ts4, java.lang.Iterable<T5> ts5, java.lang.Iterable<T6> ts6, java.lang.Iterable<T7> ts7)
Creates aFor
-comprehension of 7 Iterables.- Type Parameters:
T1
- right component type of the 1st IterableT2
- right component type of the 2nd IterableT3
- right component type of the 3rd IterableT4
- right component type of the 4th IterableT5
- right component type of the 5th IterableT6
- right component type of the 6th IterableT7
- right component type of the 7th Iterable- Parameters:
ts1
- the 1st Iterablets2
- the 2nd Iterablets3
- the 3rd Iterablets4
- the 4th Iterablets5
- the 5th Iterablets6
- the 6th Iterablets7
- the 7th Iterable- Returns:
- a new
For
-comprehension of arity 7
-
For
public static <T1,T2,T3,T4,T5,T6,T7,T8> API.For8<T1,T2,T3,T4,T5,T6,T7,T8> For(java.lang.Iterable<T1> ts1, java.lang.Iterable<T2> ts2, java.lang.Iterable<T3> ts3, java.lang.Iterable<T4> ts4, java.lang.Iterable<T5> ts5, java.lang.Iterable<T6> ts6, java.lang.Iterable<T7> ts7, java.lang.Iterable<T8> ts8)
Creates aFor
-comprehension of 8 Iterables.- Type Parameters:
T1
- right component type of the 1st IterableT2
- right component type of the 2nd IterableT3
- right component type of the 3rd IterableT4
- right component type of the 4th IterableT5
- right component type of the 5th IterableT6
- right component type of the 6th IterableT7
- right component type of the 7th IterableT8
- right component type of the 8th Iterable- Parameters:
ts1
- the 1st Iterablets2
- the 2nd Iterablets3
- the 3rd Iterablets4
- the 4th Iterablets5
- the 5th Iterablets6
- the 6th Iterablets7
- the 7th Iterablets8
- the 8th Iterable- Returns:
- a new
For
-comprehension of arity 8
-
For
public static <T1> API.For1Option<T1> For(Option<T1> ts1)
Creates aFor
-comprehension of one Option.- Type Parameters:
T1
- right component type of the 1st Option- Parameters:
ts1
- the 1st Option- Returns:
- a new
For
-comprehension of arity 1
-
For
public static <T1,T2> API.For2Option<T1,T2> For(Option<T1> ts1, Option<T2> ts2)
Creates aFor
-comprehension of two Options.- Type Parameters:
T1
- right component type of the 1st OptionT2
- right component type of the 2nd Option- Parameters:
ts1
- the 1st Optionts2
- the 2nd Option- Returns:
- a new
For
-comprehension of arity 2
-
For
public static <T1,T2,T3> API.For3Option<T1,T2,T3> For(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3)
Creates aFor
-comprehension of three Options.- Type Parameters:
T1
- right component type of the 1st OptionT2
- right component type of the 2nd OptionT3
- right component type of the 3rd Option- Parameters:
ts1
- the 1st Optionts2
- the 2nd Optionts3
- the 3rd Option- Returns:
- a new
For
-comprehension of arity 3
-
For
public static <T1,T2,T3,T4> API.For4Option<T1,T2,T3,T4> For(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4)
Creates aFor
-comprehension of 4 Options.- Type Parameters:
T1
- right component type of the 1st OptionT2
- right component type of the 2nd OptionT3
- right component type of the 3rd OptionT4
- right component type of the 4th Option- Parameters:
ts1
- the 1st Optionts2
- the 2nd Optionts3
- the 3rd Optionts4
- the 4th Option- Returns:
- a new
For
-comprehension of arity 4
-
For
public static <T1,T2,T3,T4,T5> API.For5Option<T1,T2,T3,T4,T5> For(Option<T1> ts1, Option<T2> ts2, Option<T3> ts3, Option<T4> ts4, Option<T5> ts5)
Creates aFor
-comprehension of 5 Options.- Type Parameters:
T1
- right component type of the 1st OptionT2
- right component type of the 2nd OptionT3
- right component type of the 3rd OptionT4
- right component type of the 4th OptionT5
- right component type of the 5th Option- Parameters:
ts1
- the 1st Optionts2
- the 2nd Optionts3
- the 3rd Optionts4
- the 4th Optionts5
- the 5th Option- Returns:
- a new
For
-comprehension of arity 5
-
For
public static <T1,T2,T3,T4,T5,T6> API.For6Option<T1,T2,T3,T4,T5,T6> 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.- Type Parameters:
T1
- right component type of the 1st OptionT2
- right component type of the 2nd OptionT3
- right component type of the 3rd OptionT4
- right component type of the 4th OptionT5
- right component type of the 5th OptionT6
- right component type of the 6th Option- Parameters:
ts1
- the 1st Optionts2
- the 2nd Optionts3
- the 3rd Optionts4
- the 4th Optionts5
- the 5th Optionts6
- the 6th Option- Returns:
- a new
For
-comprehension of arity 6
-
For
public static <T1,T2,T3,T4,T5,T6,T7> API.For7Option<T1,T2,T3,T4,T5,T6,T7> 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.- Type Parameters:
T1
- right component type of the 1st OptionT2
- right component type of the 2nd OptionT3
- right component type of the 3rd OptionT4
- right component type of the 4th OptionT5
- right component type of the 5th OptionT6
- right component type of the 6th OptionT7
- right component type of the 7th Option- Parameters:
ts1
- the 1st Optionts2
- the 2nd Optionts3
- the 3rd Optionts4
- the 4th Optionts5
- the 5th Optionts6
- the 6th Optionts7
- the 7th Option- Returns:
- a new
For
-comprehension of arity 7
-
For
public static <T1,T2,T3,T4,T5,T6,T7,T8> API.For8Option<T1,T2,T3,T4,T5,T6,T7,T8> 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.- Type Parameters:
T1
- right component type of the 1st OptionT2
- right component type of the 2nd OptionT3
- right component type of the 3rd OptionT4
- right component type of the 4th OptionT5
- right component type of the 5th OptionT6
- right component type of the 6th OptionT7
- right component type of the 7th OptionT8
- right component type of the 8th Option- Parameters:
ts1
- the 1st Optionts2
- the 2nd Optionts3
- the 3rd Optionts4
- the 4th Optionts5
- the 5th Optionts6
- the 6th Optionts7
- the 7th Optionts8
- the 8th Option- Returns:
- a new
For
-comprehension of arity 8
-
For
public static <T1> API.For1Future<T1> For(Future<T1> ts1)
Creates aFor
-comprehension of one Future.- Type Parameters:
T1
- right component type of the 1st Future- Parameters:
ts1
- the 1st Future- Returns:
- a new
For
-comprehension of arity 1
-
For
public static <T1,T2> API.For2Future<T1,T2> For(Future<T1> ts1, Future<T2> ts2)
Creates aFor
-comprehension of two Futures.- Type Parameters:
T1
- right component type of the 1st FutureT2
- right component type of the 2nd Future- Parameters:
ts1
- the 1st Futurets2
- the 2nd Future- Returns:
- a new
For
-comprehension of arity 2
-
For
public static <T1,T2,T3> API.For3Future<T1,T2,T3> For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3)
Creates aFor
-comprehension of three Futures.- Type Parameters:
T1
- right component type of the 1st FutureT2
- right component type of the 2nd FutureT3
- right component type of the 3rd Future- Parameters:
ts1
- the 1st Futurets2
- the 2nd Futurets3
- the 3rd Future- Returns:
- a new
For
-comprehension of arity 3
-
For
public static <T1,T2,T3,T4> API.For4Future<T1,T2,T3,T4> For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4)
Creates aFor
-comprehension of 4 Futures.- Type Parameters:
T1
- right component type of the 1st FutureT2
- right component type of the 2nd FutureT3
- right component type of the 3rd FutureT4
- right component type of the 4th Future- Parameters:
ts1
- the 1st Futurets2
- the 2nd Futurets3
- the 3rd Futurets4
- the 4th Future- Returns:
- a new
For
-comprehension of arity 4
-
For
public static <T1,T2,T3,T4,T5> API.For5Future<T1,T2,T3,T4,T5> For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5)
Creates aFor
-comprehension of 5 Futures.- Type Parameters:
T1
- right component type of the 1st FutureT2
- right component type of the 2nd FutureT3
- right component type of the 3rd FutureT4
- right component type of the 4th FutureT5
- right component type of the 5th Future- Parameters:
ts1
- the 1st Futurets2
- the 2nd Futurets3
- the 3rd Futurets4
- the 4th Futurets5
- the 5th Future- Returns:
- a new
For
-comprehension of arity 5
-
For
public static <T1,T2,T3,T4,T5,T6> API.For6Future<T1,T2,T3,T4,T5,T6> For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6)
Creates aFor
-comprehension of 6 Futures.- Type Parameters:
T1
- right component type of the 1st FutureT2
- right component type of the 2nd FutureT3
- right component type of the 3rd FutureT4
- right component type of the 4th FutureT5
- right component type of the 5th FutureT6
- right component type of the 6th Future- Parameters:
ts1
- the 1st Futurets2
- the 2nd Futurets3
- the 3rd Futurets4
- the 4th Futurets5
- the 5th Futurets6
- the 6th Future- Returns:
- a new
For
-comprehension of arity 6
-
For
public static <T1,T2,T3,T4,T5,T6,T7> API.For7Future<T1,T2,T3,T4,T5,T6,T7> For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6, Future<T7> ts7)
Creates aFor
-comprehension of 7 Futures.- Type Parameters:
T1
- right component type of the 1st FutureT2
- right component type of the 2nd FutureT3
- right component type of the 3rd FutureT4
- right component type of the 4th FutureT5
- right component type of the 5th FutureT6
- right component type of the 6th FutureT7
- right component type of the 7th Future- Parameters:
ts1
- the 1st Futurets2
- the 2nd Futurets3
- the 3rd Futurets4
- the 4th Futurets5
- the 5th Futurets6
- the 6th Futurets7
- the 7th Future- Returns:
- a new
For
-comprehension of arity 7
-
For
public static <T1,T2,T3,T4,T5,T6,T7,T8> API.For8Future<T1,T2,T3,T4,T5,T6,T7,T8> For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6, Future<T7> ts7, Future<T8> ts8)
Creates aFor
-comprehension of 8 Futures.- Type Parameters:
T1
- right component type of the 1st FutureT2
- right component type of the 2nd FutureT3
- right component type of the 3rd FutureT4
- right component type of the 4th FutureT5
- right component type of the 5th FutureT6
- right component type of the 6th FutureT7
- right component type of the 7th FutureT8
- right component type of the 8th Future- Parameters:
ts1
- the 1st Futurets2
- the 2nd Futurets3
- the 3rd Futurets4
- the 4th Futurets5
- the 5th Futurets6
- the 6th Futurets7
- the 7th Futurets8
- the 8th Future- Returns:
- a new
For
-comprehension of arity 8
-
For
public static <T1> API.For1Try<T1> For(Try<T1> ts1)
Creates aFor
-comprehension of one Try.- Type Parameters:
T1
- right component type of the 1st Try- Parameters:
ts1
- the 1st Try- Returns:
- a new
For
-comprehension of arity 1
-
For
public static <T1,T2> API.For2Try<T1,T2> For(Try<T1> ts1, Try<T2> ts2)
Creates aFor
-comprehension of two Trys.- Type Parameters:
T1
- right component type of the 1st TryT2
- right component type of the 2nd Try- Parameters:
ts1
- the 1st Tryts2
- the 2nd Try- Returns:
- a new
For
-comprehension of arity 2
-
For
public static <T1,T2,T3> API.For3Try<T1,T2,T3> For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3)
Creates aFor
-comprehension of three Trys.- Type Parameters:
T1
- right component type of the 1st TryT2
- right component type of the 2nd TryT3
- right component type of the 3rd Try- Parameters:
ts1
- the 1st Tryts2
- the 2nd Tryts3
- the 3rd Try- Returns:
- a new
For
-comprehension of arity 3
-
For
public static <T1,T2,T3,T4> API.For4Try<T1,T2,T3,T4> For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3, Try<T4> ts4)
Creates aFor
-comprehension of 4 Trys.- Type Parameters:
T1
- right component type of the 1st TryT2
- right component type of the 2nd TryT3
- right component type of the 3rd TryT4
- right component type of the 4th Try- Parameters:
ts1
- the 1st Tryts2
- the 2nd Tryts3
- the 3rd Tryts4
- the 4th Try- Returns:
- a new
For
-comprehension of arity 4
-
For
public static <T1,T2,T3,T4,T5> API.For5Try<T1,T2,T3,T4,T5> For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3, Try<T4> ts4, Try<T5> ts5)
Creates aFor
-comprehension of 5 Trys.- Type Parameters:
T1
- right component type of the 1st TryT2
- right component type of the 2nd TryT3
- right component type of the 3rd TryT4
- right component type of the 4th TryT5
- right component type of the 5th Try- Parameters:
ts1
- the 1st Tryts2
- the 2nd Tryts3
- the 3rd Tryts4
- the 4th Tryts5
- the 5th Try- Returns:
- a new
For
-comprehension of arity 5
-
For
public static <T1,T2,T3,T4,T5,T6> API.For6Try<T1,T2,T3,T4,T5,T6> For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3, Try<T4> ts4, Try<T5> ts5, Try<T6> ts6)
Creates aFor
-comprehension of 6 Trys.- Type Parameters:
T1
- right component type of the 1st TryT2
- right component type of the 2nd TryT3
- right component type of the 3rd TryT4
- right component type of the 4th TryT5
- right component type of the 5th TryT6
- right component type of the 6th Try- Parameters:
ts1
- the 1st Tryts2
- the 2nd Tryts3
- the 3rd Tryts4
- the 4th Tryts5
- the 5th Tryts6
- the 6th Try- Returns:
- a new
For
-comprehension of arity 6
-
For
public static <T1,T2,T3,T4,T5,T6,T7> API.For7Try<T1,T2,T3,T4,T5,T6,T7> For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3, Try<T4> ts4, Try<T5> ts5, Try<T6> ts6, Try<T7> ts7)
Creates aFor
-comprehension of 7 Trys.- Type Parameters:
T1
- right component type of the 1st TryT2
- right component type of the 2nd TryT3
- right component type of the 3rd TryT4
- right component type of the 4th TryT5
- right component type of the 5th TryT6
- right component type of the 6th TryT7
- right component type of the 7th Try- Parameters:
ts1
- the 1st Tryts2
- the 2nd Tryts3
- the 3rd Tryts4
- the 4th Tryts5
- the 5th Tryts6
- the 6th Tryts7
- the 7th Try- Returns:
- a new
For
-comprehension of arity 7
-
For
public static <T1,T2,T3,T4,T5,T6,T7,T8> API.For8Try<T1,T2,T3,T4,T5,T6,T7,T8> For(Try<T1> ts1, Try<T2> ts2, Try<T3> ts3, Try<T4> ts4, Try<T5> ts5, Try<T6> ts6, Try<T7> ts7, Try<T8> ts8)
Creates aFor
-comprehension of 8 Trys.- Type Parameters:
T1
- right component type of the 1st TryT2
- right component type of the 2nd TryT3
- right component type of the 3rd TryT4
- right component type of the 4th TryT5
- right component type of the 5th TryT6
- right component type of the 6th TryT7
- right component type of the 7th TryT8
- right component type of the 8th Try- Parameters:
ts1
- the 1st Tryts2
- the 2nd Tryts3
- the 3rd Tryts4
- the 4th Tryts5
- the 5th Tryts6
- the 6th Tryts7
- the 7th Tryts8
- the 8th Try- Returns:
- a new
For
-comprehension of arity 8
-
For
public static <L,T1> API.For1Either<L,T1> For(Either<L,T1> ts1)
Creates aFor
-comprehension of one Either.- Type Parameters:
L
- left component type of the given Either typesT1
- right component type of the 1st Either- Parameters:
ts1
- the 1st Either- Returns:
- a new
For
-comprehension of arity 1
-
For
public static <L,T1,T2> API.For2Either<L,T1,T2> For(Either<L,T1> ts1, Either<L,T2> ts2)
Creates aFor
-comprehension of two Eithers.- Type Parameters:
L
- left component type of the given Either typesT1
- right component type of the 1st EitherT2
- right component type of the 2nd Either- Parameters:
ts1
- the 1st Eitherts2
- the 2nd Either- Returns:
- a new
For
-comprehension of arity 2
-
For
public static <L,T1,T2,T3> API.For3Either<L,T1,T2,T3> For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3)
Creates aFor
-comprehension of three Eithers.- Type Parameters:
L
- left component type of the given Either typesT1
- right component type of the 1st EitherT2
- right component type of the 2nd EitherT3
- right component type of the 3rd Either- Parameters:
ts1
- the 1st Eitherts2
- the 2nd Eitherts3
- the 3rd Either- Returns:
- a new
For
-comprehension of arity 3
-
For
public static <L,T1,T2,T3,T4> API.For4Either<L,T1,T2,T3,T4> For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3, Either<L,T4> ts4)
Creates aFor
-comprehension of 4 Eithers.- Type Parameters:
L
- left component type of the given Either typesT1
- right component type of the 1st EitherT2
- right component type of the 2nd EitherT3
- right component type of the 3rd EitherT4
- right component type of the 4th Either- Parameters:
ts1
- the 1st Eitherts2
- the 2nd Eitherts3
- the 3rd Eitherts4
- the 4th Either- Returns:
- a new
For
-comprehension of arity 4
-
For
public static <L,T1,T2,T3,T4,T5> API.For5Either<L,T1,T2,T3,T4,T5> For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3, Either<L,T4> ts4, Either<L,T5> ts5)
Creates aFor
-comprehension of 5 Eithers.- Type Parameters:
L
- left component type of the given Either typesT1
- right component type of the 1st EitherT2
- right component type of the 2nd EitherT3
- right component type of the 3rd EitherT4
- right component type of the 4th EitherT5
- right component type of the 5th Either- Parameters:
ts1
- the 1st Eitherts2
- the 2nd Eitherts3
- the 3rd Eitherts4
- the 4th Eitherts5
- the 5th Either- Returns:
- a new
For
-comprehension of arity 5
-
For
public static <L,T1,T2,T3,T4,T5,T6> API.For6Either<L,T1,T2,T3,T4,T5,T6> For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3, Either<L,T4> ts4, Either<L,T5> ts5, Either<L,T6> ts6)
Creates aFor
-comprehension of 6 Eithers.- Type Parameters:
L
- left component type of the given Either typesT1
- right component type of the 1st EitherT2
- right component type of the 2nd EitherT3
- right component type of the 3rd EitherT4
- right component type of the 4th EitherT5
- right component type of the 5th EitherT6
- right component type of the 6th Either- Parameters:
ts1
- the 1st Eitherts2
- the 2nd Eitherts3
- the 3rd Eitherts4
- the 4th Eitherts5
- the 5th Eitherts6
- the 6th Either- Returns:
- a new
For
-comprehension of arity 6
-
For
public static <L,T1,T2,T3,T4,T5,T6,T7> API.For7Either<L,T1,T2,T3,T4,T5,T6,T7> For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3, Either<L,T4> ts4, Either<L,T5> ts5, Either<L,T6> ts6, Either<L,T7> ts7)
Creates aFor
-comprehension of 7 Eithers.- Type Parameters:
L
- left component type of the given Either typesT1
- right component type of the 1st EitherT2
- right component type of the 2nd EitherT3
- right component type of the 3rd EitherT4
- right component type of the 4th EitherT5
- right component type of the 5th EitherT6
- right component type of the 6th EitherT7
- right component type of the 7th Either- Parameters:
ts1
- the 1st Eitherts2
- the 2nd Eitherts3
- the 3rd Eitherts4
- the 4th Eitherts5
- the 5th Eitherts6
- the 6th Eitherts7
- the 7th Either- Returns:
- a new
For
-comprehension of arity 7
-
For
public static <L,T1,T2,T3,T4,T5,T6,T7,T8> API.For8Either<L,T1,T2,T3,T4,T5,T6,T7,T8> For(Either<L,T1> ts1, Either<L,T2> ts2, Either<L,T3> ts3, Either<L,T4> ts4, Either<L,T5> ts5, Either<L,T6> ts6, Either<L,T7> ts7, Either<L,T8> ts8)
Creates aFor
-comprehension of 8 Eithers.- Type Parameters:
L
- left component type of the given Either typesT1
- right component type of the 1st EitherT2
- right component type of the 2nd EitherT3
- right component type of the 3rd EitherT4
- right component type of the 4th EitherT5
- right component type of the 5th EitherT6
- right component type of the 6th EitherT7
- right component type of the 7th EitherT8
- right component type of the 8th Either- Parameters:
ts1
- the 1st Eitherts2
- the 2nd Eitherts3
- the 3rd Eitherts4
- the 4th Eitherts5
- the 5th Eitherts6
- the 6th Eitherts7
- the 7th Eitherts8
- the 8th Either- Returns:
- a new
For
-comprehension of arity 8
-
For
public static <T1> API.For1List<T1> For(List<T1> ts1)
Creates aFor
-comprehension of one List.- Type Parameters:
T1
- right component type of the 1st List- Parameters:
ts1
- the 1st List- Returns:
- a new
For
-comprehension of arity 1
-
For
public static <T1,T2> API.For2List<T1,T2> For(List<T1> ts1, List<T2> ts2)
Creates aFor
-comprehension of two Lists.- Type Parameters:
T1
- right component type of the 1st ListT2
- right component type of the 2nd List- Parameters:
ts1
- the 1st Listts2
- the 2nd List- Returns:
- a new
For
-comprehension of arity 2
-
For
public static <T1,T2,T3> API.For3List<T1,T2,T3> For(List<T1> ts1, List<T2> ts2, List<T3> ts3)
Creates aFor
-comprehension of three Lists.- Type Parameters:
T1
- right component type of the 1st ListT2
- right component type of the 2nd ListT3
- right component type of the 3rd List- Parameters:
ts1
- the 1st Listts2
- the 2nd Listts3
- the 3rd List- Returns:
- a new
For
-comprehension of arity 3
-
For
public static <T1,T2,T3,T4> API.For4List<T1,T2,T3,T4> For(List<T1> ts1, List<T2> ts2, List<T3> ts3, List<T4> ts4)
Creates aFor
-comprehension of 4 Lists.- Type Parameters:
T1
- right component type of the 1st ListT2
- right component type of the 2nd ListT3
- right component type of the 3rd ListT4
- right component type of the 4th List- Parameters:
ts1
- the 1st Listts2
- the 2nd Listts3
- the 3rd Listts4
- the 4th List- Returns:
- a new
For
-comprehension of arity 4
-
For
public static <T1,T2,T3,T4,T5> API.For5List<T1,T2,T3,T4,T5> For(List<T1> ts1, List<T2> ts2, List<T3> ts3, List<T4> ts4, List<T5> ts5)
Creates aFor
-comprehension of 5 Lists.- Type Parameters:
T1
- right component type of the 1st ListT2
- right component type of the 2nd ListT3
- right component type of the 3rd ListT4
- right component type of the 4th ListT5
- right component type of the 5th List- Parameters:
ts1
- the 1st Listts2
- the 2nd Listts3
- the 3rd Listts4
- the 4th Listts5
- the 5th List- Returns:
- a new
For
-comprehension of arity 5
-
For
public static <T1,T2,T3,T4,T5,T6> API.For6List<T1,T2,T3,T4,T5,T6> For(List<T1> ts1, List<T2> ts2, List<T3> ts3, List<T4> ts4, List<T5> ts5, List<T6> ts6)
Creates aFor
-comprehension of 6 Lists.- Type Parameters:
T1
- right component type of the 1st ListT2
- right component type of the 2nd ListT3
- right component type of the 3rd ListT4
- right component type of the 4th ListT5
- right component type of the 5th ListT6
- right component type of the 6th List- Parameters:
ts1
- the 1st Listts2
- the 2nd Listts3
- the 3rd Listts4
- the 4th Listts5
- the 5th Listts6
- the 6th List- Returns:
- a new
For
-comprehension of arity 6
-
For
public static <T1,T2,T3,T4,T5,T6,T7> API.For7List<T1,T2,T3,T4,T5,T6,T7> For(List<T1> ts1, List<T2> ts2, List<T3> ts3, List<T4> ts4, List<T5> ts5, List<T6> ts6, List<T7> ts7)
Creates aFor
-comprehension of 7 Lists.- Type Parameters:
T1
- right component type of the 1st ListT2
- right component type of the 2nd ListT3
- right component type of the 3rd ListT4
- right component type of the 4th ListT5
- right component type of the 5th ListT6
- right component type of the 6th ListT7
- right component type of the 7th List- Parameters:
ts1
- the 1st Listts2
- the 2nd Listts3
- the 3rd Listts4
- the 4th Listts5
- the 5th Listts6
- the 6th Listts7
- the 7th List- Returns:
- a new
For
-comprehension of arity 7
-
For
public static <T1,T2,T3,T4,T5,T6,T7,T8> API.For8List<T1,T2,T3,T4,T5,T6,T7,T8> For(List<T1> ts1, List<T2> ts2, List<T3> ts3, List<T4> ts4, List<T5> ts5, List<T6> ts6, List<T7> ts7, List<T8> ts8)
Creates aFor
-comprehension of 8 Lists.- Type Parameters:
T1
- right component type of the 1st ListT2
- right component type of the 2nd ListT3
- right component type of the 3rd ListT4
- right component type of the 4th ListT5
- right component type of the 5th ListT6
- right component type of the 6th ListT7
- right component type of the 7th ListT8
- right component type of the 8th List- Parameters:
ts1
- the 1st Listts2
- the 2nd Listts3
- the 3rd Listts4
- the 4th Listts5
- the 5th Listts6
- the 6th Listts7
- the 7th Listts8
- the 8th List- Returns:
- a new
For
-comprehension of arity 8
-
Match
@GwtIncompatible public static <T> API.Match<T> Match(T value)
Entry point of the match API.- Type Parameters:
T
- type of the value- Parameters:
value
- a value to be matched- Returns:
- a new
Match
instance
-
Case
@GwtIncompatible public static <T,R> API.Match.Case<T,R> Case(API.Match.Pattern0<T> pattern, java.util.function.Function<? super T,? extends R> f)
-
Case
@GwtIncompatible public static <T,R> API.Match.Case<T,R> Case(API.Match.Pattern0<T> pattern, java.util.function.Supplier<? extends R> supplier)
-
Case
@GwtIncompatible public static <T,R> API.Match.Case<T,R> Case(API.Match.Pattern0<T> pattern, R retVal)
-
Case
@GwtIncompatible public static <T,T1,R> API.Match.Case<T,R> Case(API.Match.Pattern1<T,T1> pattern, java.util.function.Function<? super T1,? extends R> f)
-
Case
@GwtIncompatible public static <T,T1,R> API.Match.Case<T,R> Case(API.Match.Pattern1<T,T1> pattern, java.util.function.Supplier<? extends R> supplier)
-
Case
@GwtIncompatible public static <T,T1,R> API.Match.Case<T,R> Case(API.Match.Pattern1<T,T1> pattern, R retVal)
-
Case
@GwtIncompatible public static <T,T1,T2,R> API.Match.Case<T,R> Case(API.Match.Pattern2<T,T1,T2> pattern, java.util.function.BiFunction<? super T1,? super T2,? extends R> f)
-
Case
@GwtIncompatible public static <T,T1,T2,R> API.Match.Case<T,R> Case(API.Match.Pattern2<T,T1,T2> pattern, java.util.function.Supplier<? extends R> supplier)
-
Case
@GwtIncompatible public static <T,T1,T2,R> API.Match.Case<T,R> Case(API.Match.Pattern2<T,T1,T2> pattern, R retVal)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,R> API.Match.Case<T,R> Case(API.Match.Pattern3<T,T1,T2,T3> pattern, Function3<? super T1,? super T2,? super T3,? extends R> f)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,R> API.Match.Case<T,R> Case(API.Match.Pattern3<T,T1,T2,T3> pattern, java.util.function.Supplier<? extends R> supplier)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,R> API.Match.Case<T,R> Case(API.Match.Pattern3<T,T1,T2,T3> pattern, R retVal)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,R> API.Match.Case<T,R> Case(API.Match.Pattern4<T,T1,T2,T3,T4> pattern, Function4<? super T1,? super T2,? super T3,? super T4,? extends R> f)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,R> API.Match.Case<T,R> Case(API.Match.Pattern4<T,T1,T2,T3,T4> pattern, java.util.function.Supplier<? extends R> supplier)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,R> API.Match.Case<T,R> Case(API.Match.Pattern4<T,T1,T2,T3,T4> pattern, R retVal)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,R> API.Match.Case<T,R> Case(API.Match.Pattern5<T,T1,T2,T3,T4,T5> pattern, Function5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> f)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,R> API.Match.Case<T,R> Case(API.Match.Pattern5<T,T1,T2,T3,T4,T5> pattern, java.util.function.Supplier<? extends R> supplier)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,R> API.Match.Case<T,R> Case(API.Match.Pattern5<T,T1,T2,T3,T4,T5> pattern, R retVal)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,T6,R> API.Match.Case<T,R> Case(API.Match.Pattern6<T,T1,T2,T3,T4,T5,T6> pattern, Function6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> f)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,T6,R> API.Match.Case<T,R> Case(API.Match.Pattern6<T,T1,T2,T3,T4,T5,T6> pattern, java.util.function.Supplier<? extends R> supplier)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,T6,R> API.Match.Case<T,R> Case(API.Match.Pattern6<T,T1,T2,T3,T4,T5,T6> pattern, R retVal)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,T6,T7,R> API.Match.Case<T,R> Case(API.Match.Pattern7<T,T1,T2,T3,T4,T5,T6,T7> pattern, Function7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> f)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,T6,T7,R> API.Match.Case<T,R> Case(API.Match.Pattern7<T,T1,T2,T3,T4,T5,T6,T7> pattern, java.util.function.Supplier<? extends R> supplier)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,T6,T7,R> API.Match.Case<T,R> Case(API.Match.Pattern7<T,T1,T2,T3,T4,T5,T6,T7> pattern, R retVal)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,T6,T7,T8,R> API.Match.Case<T,R> Case(API.Match.Pattern8<T,T1,T2,T3,T4,T5,T6,T7,T8> pattern, Function8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> f)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,T6,T7,T8,R> API.Match.Case<T,R> Case(API.Match.Pattern8<T,T1,T2,T3,T4,T5,T6,T7,T8> pattern, java.util.function.Supplier<? extends R> supplier)
-
Case
@GwtIncompatible public static <T,T1,T2,T3,T4,T5,T6,T7,T8,R> API.Match.Case<T,R> Case(API.Match.Pattern8<T,T1,T2,T3,T4,T5,T6,T7,T8> pattern, R retVal)
-
$
@GwtIncompatible public static <T> API.Match.Pattern0<T> $()
Wildcard pattern, matches any value.- Type Parameters:
T
- injected type of the underlying value- Returns:
- a new
Pattern0
instance
-
$
@GwtIncompatible public static <T> API.Match.Pattern0<T> $(T prototype)
Value pattern, checks for equality.- Type Parameters:
T
- type of the prototype- Parameters:
prototype
- the value that should be equal to the underlying object- Returns:
- a new
Pattern0
instance
-
$
@GwtIncompatible public static <T> API.Match.Pattern0<T> $(java.util.function.Predicate<? super T> predicate)
Guard pattern, checks if a predicate is satisfied.This method is intended to be used with lambdas and method references, for example:
It is also valid to passString evenOrOdd(int num) { return Match(num).of( Case($(i -> i % 2 == 0), "even"), Case($(this::isOdd), "odd") ); } boolean isOdd(int i) { return i % 2 == 1; }
Predicate
instances:
Note: Please take care when matchingPredicate<Integer> isOdd = i -> i % 2 == 1; Match(num).of( Case($(i -> i % 2 == 0), "even"), Case($(isOdd), "odd") );
Predicate
instances. In general, function equality is an undecidable problem in computer science. In Vavr we are only able to check, if two functions are the same instance.However, this code will fail:
Instead we have to usePredicate<Integer> p = i -> true; Match(p).of( Case($(p), 1) // WRONG! It calls $(Predicate) );
Predicates.is(Object)
:Predicate<Integer> p = i -> true; Match(p).of( Case($(is(p)), 1) // CORRECT! It calls $(T) );
- Type Parameters:
T
- type of the prototype- Parameters:
predicate
- the predicate that tests a given value- Returns:
- a new
Pattern0
instance
-
-