Class API.Match.Pattern1<T,T1>
java.lang.Object
io.vavr.API.Match.Pattern1<T,T1>
- Type Parameters:
T- Class type that is matched by this patternT1- Member type 1 of the composite part this pattern decomposes
- All Implemented Interfaces:
API.Match.Pattern<T,T1>, Function1<T, T1>, PartialFunction<T, T1>, Serializable, Function<T, T1>
public abstract static class API.Match.Pattern1<T,T1>
extends Object
implements API.Match.Pattern<T,T1>
A
API.Match.Pattern implementation for the pattern with 1 intermediate type- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longThe serial version UID for serialization. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T, T1 extends U1, U1>
API.Match.Pattern1<T, T1> of(@NonNull Class<? super T> type, @NonNull API.Match.Pattern<T1, ?> p1, @NonNull Function<T, Tuple1<U1>> unapply) Static factory for aAPI.Match.Pattern1based on aClass,API.Match.Patternto decompose it to and a mapper to aggregate result back into aTuple1Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Function1
andThen, arity, compose, compose1, curried, isMemoized, memoized, partial, reversed, tupledMethods inherited from interface PartialFunction
apply, isDefinedAt, lift
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDThe serial version UID for serialization.- See Also:
-
-
Constructor Details
-
Pattern1
protected Pattern1()Creates a newPattern1.This constructor is protected because
Pattern1is abstract and intended to be subclassed rather than instantiated directly.
-
-
Method Details
-
of
public static <T, T1 extends U1, U1> API.Match.Pattern1<T,T1> of(@NonNull Class<? super T> type, @NonNull API.Match.Pattern<T1, ?> p1, @NonNull Function<T, Tuple1<U1>> unapply) Static factory for aAPI.Match.Pattern1based on aClass,API.Match.Patternto decompose it to and a mapper to aggregate result back into aTuple1- Type Parameters:
T- Class type matched by this patternT1- Member type 1 of the composite part this pattern decomposesU1- Member type 1 of the Tuple the composite part of this pattern decomposes to- Parameters:
type-Classto build the pattern fromp1-API.Match.Patternmatching the intermediate type 1unapply- Mapper function from T to aTuple1- Returns:
- new Pattern1
-