Class SolrMatchers

java.lang.Object
org.apache.solr.util.SolrMatchers

public class SolrMatchers extends Object
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
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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