Package org.apache.solr.util
Class SolrMatchers
- java.lang.Object
-
- org.apache.solr.util.SolrMatchers
-
public class SolrMatchers extends Object
A Utility class for extra HamcrestMatcher
implementations.These may be directly related to Solr, or be filling gaps that the default Hamcrest Matchers do not cover.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SolrMatchers.SubListMatcher<T>
-
Constructor Summary
Constructors Constructor Description SolrMatchers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> org.hamcrest.Matcher<List<? extends T>>
subListMatches(int fromIndex, int toIndex, org.hamcrest.Matcher<? super List<? super T>> subListMatcher)
Matches a segment of a list between two indices against a provided matcher, useful for checking ordered and unordered sub-sequences in a larger list
-
-
-
Method Detail
-
subListMatches
public static <T> org.hamcrest.Matcher<List<? extends T>> subListMatches(int fromIndex, int toIndex, org.hamcrest.Matcher<? super List<? super T>> subListMatcher)
Matches a segment of a list between two indices against a provided matcher, useful for checking ordered and unordered sub-sequences in a larger list- Type Parameters:
T
- The type that the list being matched against will contain- Parameters:
fromIndex
- starting index of the desired sub-list (inclusive)toIndex
- ending index of the desired sub-list (exclusive)subListMatcher
- matcher for the resulting sub-list- Returns:
- a Matcher for the original super-list
-
-