com.aol.cyclops.matcher.CollectionMatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cyclops-pattern-matching-collections Show documentation
Show all versions of cyclops-pattern-matching-collections Show documentation
Advanced pattern matching for Java 8
package com.aol.cyclops.matcher;
import com.aol.cyclops.matcher.builders.IterableCase;
import com.aol.cyclops.matcher.builders.PatternMatcher;
import com.aol.cyclops.matcher.builders.StreamCase;
public class CollectionMatcher {
/**
* Create a builder for matching on the disaggregated elements of a collection.
*
* Allows matching by type, value, JDK 8 Predicate, or Hamcrest Matcher per element
*
* @return Iterable / Collection based Pattern Matching Builder
*/
public static final IterableCase whenIterable(){
IterableCase cse = new IterableCase(new PatternMatcher());
return cse;
}
/**
* Create a builder that builds Pattern Matching Cases from Streams of data.
*
*
* @return Stream based Pattern Matching Builder
*/
public static final StreamCase whenFromStream(){
StreamCase cse = new StreamCase(new PatternMatcher());
return cse;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy