T
- Input type to match againstR
- Return type if matchedpublic static class Matchable.CheckValue3<T1,T2,T3,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 com.aol.cyclops.internal.matcher2.MatchableCase<R> |
simplerCase |
Constructor and Description |
---|
CheckValue3() |
Modifier and Type | Method and Description |
---|---|
Matchable.CheckValue3<T1,T2,T3,R> |
is(Matchable.MTuple3<java.util.function.Predicate<? super T1>,java.util.function.Predicate<? super T2>,java.util.function.Predicate<? super T3>> when,
java.util.function.Supplier<? extends R> then)
Check that the provided Tuple-of-Predicates (use
Matchable.when(Predicate, Predicate, Predicate) or Matchable.when(Object,Object,Object) to create it)
matches the first 3 values of our target values to match on |
Matchable.CheckValue3<T1,T2,T3,R> |
isEmpty(java.util.function.Supplier<? extends R> then) |
protected final com.aol.cyclops.internal.matcher2.MatchableCase<R> simplerCase
public final Matchable.CheckValue3<T1,T2,T3,R> is(Matchable.MTuple3<java.util.function.Predicate<? super T1>,java.util.function.Predicate<? super T2>,java.util.function.Predicate<? super T3>> when, java.util.function.Supplier<? extends R> then)
Matchable.when(Predicate, Predicate, Predicate)
or Matchable.when(Object,Object,Object)
to create it)
matches the first 3 values of our target values to match on
Matchables.match3(100,2,1000)
.matches(c->c.is(when(Predicates.greaterThan(50),Predicates.lessThan(10),Predicates.greaterThan(500)), ()->"large and small and huge"), ()->"not large and small")
.get(),
//"large and small and huge"
when
- Tuple containing a predicates to match against the first 3 elements / fieldsthen
- Supplier to execute provide return value if match found