@Deprecated public class CollectionMatchingInstance<T,X> extends MatchingInstance<T,X> implements java.util.function.Function<T,java.util.Optional<X>>
| Constructor and Description |
|---|
CollectionMatchingInstance(CaseBeingBuilt cse)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<X> |
apply(java.lang.Object t)
Deprecated.
|
java.util.function.Function<T,java.util.stream.Stream<X>> |
asStreamFunction()
Deprecated.
|
java.util.function.Function<T,X> |
asUnwrappedFunction()
Deprecated.
|
Cases<T,X,TypedFunction<T,X>> |
cases()
Deprecated.
|
java.util.Optional<X> |
match(java.lang.Object... t)
Deprecated.
Aggregates supplied objects into a List for matching against
|
java.util.Optional<X> |
match(java.lang.Object t)
Deprecated.
|
<R> java.util.stream.Stream<R> |
matchFromStream(java.util.stream.Stream s)
Deprecated.
Each input element can generated a single matched value
|
<R> java.util.stream.Stream<R> |
matchMany(java.lang.Object t)
Deprecated.
|
<R> java.util.stream.Stream<R> |
matchManyFromStream(java.util.stream.Stream s)
Deprecated.
Each input element can generated multiple matched values
|
java.util.Optional<X> |
unapply(com.aol.cyclops.objects.Decomposable decomposableObject)
Deprecated.
Immediately decompose the supplied parameter and pass it to the PatternMatcher for matching
|
StreamCase |
whenFromStream()
Deprecated.
Create a builder that builds Pattern Matching Cases from Streams of data.
|
IterableCase<X> |
whenIterable()
Deprecated.
Create a builder for matching on the disaggregated elements of a collection.
|
when, whenAllMatch, whenAnyMatch, whenIsMatch, whenIsTrue, whenIsType, whenIsValue, whenNoneMatchpublic CollectionMatchingInstance(CaseBeingBuilt cse)
public final Cases<T,X,TypedFunction<T,X>> cases()
cases in class MatchingInstance<T,X>public final IterableCase<X> whenIterable()
public final StreamCase whenFromStream()
public java.util.function.Function<T,X> asUnwrappedFunction()
asUnwrappedFunction in class MatchingInstance<T,X>public java.util.function.Function<T,java.util.stream.Stream<X>> asStreamFunction()
asStreamFunction in class MatchingInstance<T,X>public java.util.Optional<X> apply(java.lang.Object t)
public <R> java.util.stream.Stream<R> matchManyFromStream(java.util.stream.Stream s)
matchManyFromStream in class MatchingInstance<T,X>s - Stream of data to match against (input to matcher)public <R> java.util.stream.Stream<R> matchMany(java.lang.Object t)
matchMany in class MatchingInstance<T,X>t - input to match against - can generate multiple valuespublic <R> java.util.stream.Stream<R> matchFromStream(java.util.stream.Stream s)
matchFromStream in class MatchingInstance<T,X>s - Stream of data to match against (input to matcher)public java.util.Optional<X> match(java.lang.Object... t)
assertThat(Cases.of(Case.of((List<Integer> input) -> input.size()==3, input -> "hello"),
Case.of((List<Integer> input) -> input.size()==2, input -> "ignored"),
Case.of((List<Integer> input) -> input.size()==1, input -> "world")).match(1,2,3).get(),is("hello"));
match in class MatchingInstance<T,X>t - Array to match onpublic java.util.Optional<X> match(java.lang.Object t)
match in class MatchingInstance<T,X>t - Object to match against supplied casespublic java.util.Optional<X> unapply(com.aol.cyclops.objects.Decomposable decomposableObject)
unapply in class MatchingInstance<T,X>decomposableObject - Object to match on after decomposed via unapply method