Package org.apache.solr.util
Class SolrMatchers
java.lang.Object
org.apache.solr.util.SolrMatchers
A Utility class for extra Hamcrest
Matcher 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <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
-
Constructor Details
-
SolrMatchers
public SolrMatchers()
-
-
Method Details
-
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
-