public interface WithPatternMatching
| Modifier and Type | Method and Description |
|---|---|
default <T> FunctionalPredicate<T,T> |
functionalPredicate(Predicate<T> predicate)
Composes a predicate with the identity function.
|
default <T,R> FunctionalPredicate<T,R> |
functionalPredicate(Predicate<T> predicate,
Function<T,R> function)
Composes a predicate and a function.
|
default <T> CaseAcceptor<T> |
match(T value)
Match captures the value to match against returning a CaseAcceptor.
|
default <T,R> Case<T,R> |
orElse(Function<T,R> f)
Default case.
|
default <T,R> Case<T,R> |
orElse(R result)
Default case.
|
default <T> FunctionalPredicateWrapper<T,T> |
whenClass(Class<T> clazz)
When wraps a class as predicate to match against that class.
|
default <T,R> FunctionalPredicateWrapper<T,R> |
whenFunctionalPredicate(FunctionalPredicate<T,R> functionalPredicate)
When wraps a value as predicate.
|
default <T> FunctionalPredicateWrapper<T,T> |
whenPredicate(Predicate<T> predicate)
When wraps a value as predicate.
|
default FunctionalPredicateWrapper<CharSequence,CharSequence> |
whenRegEx(Pattern pattern)
When wraps a regular expression pattern as predicate.
|
default FunctionalPredicateWrapper<CharSequence,CharSequence> |
whenRegEx(String pattern)
When wraps a regular expression pattern as predicate.
|
default <T> FunctionalPredicateWrapper<T,T> |
whenValue(T value)
When wraps a value as predicate to match for equality.
|
default <T,R> PatternMatcher<T,R> |
with(Case<T,R>... cases)
Creates a pattern matcher to match with.
|
default <T> FunctionalPredicate<T,T> functionalPredicate(Predicate<T> predicate)
T - type of the predicate argumentpredicate - predicate to compose withdefault <T,R> FunctionalPredicate<T,R> functionalPredicate(Predicate<T> predicate, Function<T,R> function)
T - type of the predicate argumentR - type of the result of the functionpredicate - predicate to compose withfunction - function to compose withdefault <T> CaseAcceptor<T> match(T value)
T - type of the value to capturevalue - the value to capturedefault <T,R> Case<T,R> orElse(Function<T,R> f)
T - type of the argument of the case expressionR - type of the result of the case expressionf - function to perform on default casedefault <T,R> Case<T,R> orElse(R result)
T - type of the argument of the case expressionR - type of the result of the case expressionresult - to returndefault <T> FunctionalPredicateWrapper<T,T> whenClass(Class<T> clazz)
T - type of the classclazz - class to matchdefault <T,R> FunctionalPredicateWrapper<T,R> whenFunctionalPredicate(FunctionalPredicate<T,R> functionalPredicate)
T - type of the predicate argumentR - type of the result of the functionfunctionalPredicate - functional predicatedefault <T> FunctionalPredicateWrapper<T,T> whenPredicate(Predicate<T> predicate)
T - type of the predicate argumentpredicate - predicatedefault FunctionalPredicateWrapper<CharSequence,CharSequence> whenRegEx(Pattern pattern)
pattern - to match againstdefault FunctionalPredicateWrapper<CharSequence,CharSequence> whenRegEx(String pattern)
pattern - to match againstdefault <T> FunctionalPredicateWrapper<T,T> whenValue(T value)
T - type of the valuevalue - to matchdefault <T,R> PatternMatcher<T,R> with(Case<T,R>... cases)
T - type of the argument of the case expressionR - type of the result of the case expressioncases - cases to match withCopyright © 2021. All rights reserved.