T - Input type to match againstR - Return type if matchedpublic static class Matchable.CheckValue4<T1,T2,T3,T4,R>
extends java.lang.Object
is(when(1,2,3),then("match")) : must have values 1,2,3 only in that order
has(when(1,2,3),then("match")) : must have values 1,2,3 in that order, but may also have additional values
*| Modifier and Type | Field and Description |
|---|---|
protected MatchableCase<R> |
simplerCase |
| Constructor and Description |
|---|
CheckValue4() |
| Modifier and Type | Method and Description |
|---|---|
Matchable.CheckValue4<T1,T2,T3,T4,R> |
is(Matchable.MTuple4<java.util.function.Predicate<? super T1>,java.util.function.Predicate<? super T2>,java.util.function.Predicate<? super T3>,java.util.function.Predicate<? super T4>> when,
java.util.function.Supplier<? extends R> then)
Check that the provided Tuple-of-Predicates (use
Matchable.when(Predicate, Predicate, Predicate, Predicate) or Matchable.when(Object,Object,Object, Object)
to create it) matches the first 4 values of our target values to match on |
Matchable.CheckValue4<T1,T2,T3,T4,R> |
isEmpty(java.util.function.Supplier<? extends R> then) |
protected final MatchableCase<R> simplerCase
public final Matchable.CheckValue4<T1,T2,T3,T4,R> is(Matchable.MTuple4<java.util.function.Predicate<? super T1>,java.util.function.Predicate<? super T2>,java.util.function.Predicate<? super T3>,java.util.function.Predicate<? super T4>> when, java.util.function.Supplier<? extends R> then)
Matchable.when(Predicate, Predicate, Predicate, Predicate) or Matchable.when(Object,Object,Object, Object)
to create it) matches the first 4 values of our target values to match on
Matchables.match4(100,2,1000,1)
.matches(c->c.is(when(Predicates.greaterThan(50),
Predicates.lessThan(10),
Predicates.greaterThan(500),
Predicates.lessThan(2)), ()->"large and small and huge and tiny"), ()->"not large and small")
.get()
Eval["large and small and huge and tiny"]
when - Tuple containing a predicates to match against the first 4 elements / fieldsthen - Supplier to execute provide return value if match found