hasGuard
@SafeVarargs
public final <V> java.util.function.Predicate<V> hasGuard(V... values)
Generate a predicate that determines the provided values hold.
Values can be comparison value, JDK 8 Predicate, or Hamcrest Matcher
for each Element to match on.
isType will attempt to match on the type of the supplied Case class. If it matches the Case class will be 'decomposed' via it's unapply method
and the Case will then attempt to match on each of the elements that make up the Case class. If the Case class implements Decomposable, that interface and it's
unapply method will be used. Otherwise in Extractors it is possible to register Decomposition Funcitons that will unapply Case classes from other sources (e.g.
javaslang, jADT or even Scala). If no Decomposition Function has been registered, reflection will be used to call an unapply method on the Case class if it exists.
- Parameters:
values
- Matching rules for each element in the decomposed / unapplied user input
- Returns:
- A single Predicate encompassing supplied rules
- See Also:
Extractors.decompose()
,
com.aol.cyclops.internal.matcher2.Extractors#registerDecompositionFunction