Package de.xima.fc.common.data.algebraic
Interface OneOfN.OneOf4Matcher<R,T1,T2,T3,T4>
-
- Type Parameters:
R
- Type of the value returned by the mapping function for each case.T1
- Type of the first case.T2
- Type of the second case.T3
- Type of the third case.T4
- Type of the fourth case.
- Enclosing class:
- OneOfN
public static interface OneOfN.OneOf4Matcher<R,T1,T2,T3,T4>
A matcher object that contains a handler for each case and can be used to reduce a sum type to a single value. This interface contains a default implementation for each case that simply returnsnull
.
-
-
Method Detail
-
first
default R first(T1 first)
- Parameters:
first
- The value of the first case.- Returns:
- The mapped value for the first case
-
fourth
default R fourth(T4 fourth)
- Parameters:
fourth
- The value of the fourth case.- Returns:
- The mapped value for the fourth case
-
second
default R second(T2 second)
- Parameters:
second
- The value of the second case.- Returns:
- The mapped value for the second case
-
-