public class Matching
extends java.lang.Object
| Constructor and Description |
|---|
Matching() |
| Modifier and Type | Method and Description |
|---|---|
static <T,X> MatchingInstance<T,X> |
of(Cases<T,X,? extends java.util.function.Function<T,X>> cases)
Create a Pattern Matcher Builder from supplied Cases
|
static <X> ElementCase<X> |
when()
Create a builder for Matching against a provided Object as is (i.e.
|
static <X> MatchingInstance<? extends java.lang.Object,X> |
when(java.util.function.Function<CheckTypeAndValues<? extends java.lang.Object>,MatchingInstance<? extends java.lang.Object,X>> fn)
Deprecated.
|
static StreamCase |
whenFromStream()
Create a builder that builds Pattern Matching Cases from Streams of data.
|
static <T,X> MatchingInstance<T,X> |
whenFromStream(java.util.function.Function<CaseBeingBuilt,MatchingInstance<T,X>> fn)
Deprecated.
|
static <USER_VALUE> |
whenIterable()
Create a builder for matching on the disaggregated elements of a collection.
|
static <X> MatchingInstance<? extends java.lang.Object,X> |
whenIterable(java.util.function.Function<IterableCase<? extends java.lang.Object>,MatchingInstance<? extends java.lang.Object,X>> fn)
Deprecated.
|
static <USER_VALUE> |
whenValues()
Create a builder for Matching on Case classes.
|
static <X> MatchingInstance<? extends java.lang.Object,X> |
whenValues(java.util.function.Function<ElementCase<X>,MatchingInstance<? extends java.lang.Object,X>> fn)
Deprecated.
|
public static final <T,X> MatchingInstance<T,X> of(Cases<T,X,? extends java.util.function.Function<T,X>> cases)
cases - to match onpublic static final <USER_VALUE> CheckTypeAndValues<USER_VALUE> whenValues()
\@Value final class CaseClass implements Decomposable { int field1; String field2;}
Use with static imports from the Predicates class to get wildcards via '__' or ANY()
And to apply nested / recursive matching via Predicates.type( ).with ( )
Match disaggregated elements by type, value, JDK 8 Predicate or Hamcrest Matcherpublic static final <X> ElementCase<X> when()
public static final <USER_VALUE> IterableCase<USER_VALUE> whenIterable()
public static final StreamCase whenFromStream()
@Deprecated public static final <X> MatchingInstance<? extends java.lang.Object,X> when(java.util.function.Function<CheckTypeAndValues<? extends java.lang.Object>,MatchingInstance<? extends java.lang.Object,X>> fn)
\@Value final class CaseClass implements Decomposable { int field1; String field2;}
Use with static imports from the Predicates class to get wildcards via '__' or ANY()
And to apply nested / recursive matching via Predicates.type( ).with ( )
Match disaggregated elements by type, value, JDK 8 Predicate or Hamcrest Matcherfn - Function that accepts the Case for Case classes and returns the output of that builder@Deprecated public static final <X> MatchingInstance<? extends java.lang.Object,X> whenValues(java.util.function.Function<ElementCase<X>,MatchingInstance<? extends java.lang.Object,X>> fn)
fn - Function that accepts a Simplex Element based Pattern Matching Builder and returns it's output@Deprecated public static final <X> MatchingInstance<? extends java.lang.Object,X> whenIterable(java.util.function.Function<IterableCase<? extends java.lang.Object>,MatchingInstance<? extends java.lang.Object,X>> fn)
fn - a Function that accepts a Iterable / Collection based Pattern Matching Builder and returns it's output@Deprecated public static final <T,X> MatchingInstance<T,X> whenFromStream(java.util.function.Function<CaseBeingBuilt,MatchingInstance<T,X>> fn)
fn - a function that accepts a Stream based pattern matching builder