Class RectangleMatcher

java.lang.Object
org.hamcrest.BaseMatcher<Rectangle>
org.hamcrest.TypeSafeMatcher<Rectangle>
org.elasticsearch.test.hamcrest.RectangleMatcher
All Implemented Interfaces:
org.hamcrest.Matcher<Rectangle>, org.hamcrest.SelfDescribing

public class RectangleMatcher extends org.hamcrest.TypeSafeMatcher<Rectangle>
Example usage: assertThat(actualRectangle, RectangleMatcher.closeTo(expectedRectangle, 0.0001, PointType.CARTESIAN));, or it can be used as a parameter to WellKnownBinaryBytesRefMatcher.
  • Method Details

    • closeTo

      public static org.hamcrest.TypeSafeMatcher<Rectangle> closeTo(Rectangle r, double error, CoordinateEncoder coordinateEncoder)
    • closeToFloat

      public static org.hamcrest.TypeSafeMatcher<Rectangle> closeToFloat(Rectangle r, double v, CoordinateEncoder encoder)
      Casts the rectangle coordinates to floats before comparing. Useful when working with extents which hold the coordinate data as ints.
    • matchesSafely

      protected boolean matchesSafely(Rectangle other)
      Specified by:
      matchesSafely in class org.hamcrest.TypeSafeMatcher<Rectangle>
    • describeMismatchSafely

      public void describeMismatchSafely(Rectangle rectangle, org.hamcrest.Description description)
      Overrides:
      describeMismatchSafely in class org.hamcrest.TypeSafeMatcher<Rectangle>
    • describeTo

      public void describeTo(org.hamcrest.Description description)