Package io.vavr
Class API.Match<T>
- java.lang.Object
-
- io.vavr.API.Match<T>
-
- Type Parameters:
T
- type of the object that is matched
- Enclosing class:
- API
@GwtIncompatible public static final class API.Match<T> extends java.lang.Object
Scala-like structural pattern matching for Java. Instances are obtained viaAPI.Match(Object)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
API.Match.Case<T,R>
static class
API.Match.Case0<T,R>
static class
API.Match.Case1<T,T1,R>
static class
API.Match.Case2<T,T1,T2,R>
static class
API.Match.Case3<T,T1,T2,T3,R>
static class
API.Match.Case4<T,T1,T2,T3,T4,R>
static class
API.Match.Case5<T,T1,T2,T3,T4,T5,R>
static class
API.Match.Case6<T,T1,T2,T3,T4,T5,T6,R>
static class
API.Match.Case7<T,T1,T2,T3,T4,T5,T6,T7,R>
static class
API.Match.Case8<T,T1,T2,T3,T4,T5,T6,T7,T8,R>
static interface
API.Match.Pattern<T,R>
A Pattern is a partialFunction
in the sense that a function applications returns an optional result of typeOption<R>
.static class
API.Match.Pattern0<T>
static class
API.Match.Pattern1<T,T1>
static class
API.Match.Pattern2<T,T1,T2>
static class
API.Match.Pattern3<T,T1,T2,T3>
static class
API.Match.Pattern4<T,T1,T2,T3,T4>
static class
API.Match.Pattern5<T,T1,T2,T3,T4,T5>
static class
API.Match.Pattern6<T,T1,T2,T3,T4,T5,T6>
static class
API.Match.Pattern7<T,T1,T2,T3,T4,T5,T6,T7>
static class
API.Match.Pattern8<T,T1,T2,T3,T4,T5,T6,T7,T8>
-
Method Summary
Modifier and Type Method Description <R> R
of(API.Match.Case<? extends T,? extends R>... cases)
<R> Option<R>
option(API.Match.Case<? extends T,? extends R>... cases)
-
-
-
Method Detail
-
of
@SafeVarargs public final <R> R of(API.Match.Case<? extends T,? extends R>... cases)
-
option
@SafeVarargs public final <R> Option<R> option(API.Match.Case<? extends T,? extends R>... cases)
-
-