Class RectangleMatcher

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

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

    Modifier and Type
    Method
    Description
    static org.hamcrest.TypeSafeMatcher<org.elasticsearch.geometry.Rectangle>
    closeTo(org.elasticsearch.geometry.Rectangle r, double error, CoordinateEncoder coordinateEncoder)
     
    static org.hamcrest.TypeSafeMatcher<org.elasticsearch.geometry.Rectangle>
    closeToFloat(org.elasticsearch.geometry.Rectangle r, double v, CoordinateEncoder encoder)
    Casts the rectangle coordinates to floats before comparing.
    void
    describeMismatchSafely(org.elasticsearch.geometry.Rectangle rectangle, org.hamcrest.Description description)
     
    void
    describeTo(org.hamcrest.Description description)
     
    protected boolean
    matchesSafely(org.elasticsearch.geometry.Rectangle other)
     

    Methods inherited from class org.hamcrest.TypeSafeMatcher

    describeMismatch, matches

    Methods inherited from class org.hamcrest.BaseMatcher

    _dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • closeTo

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

      public static org.hamcrest.TypeSafeMatcher<org.elasticsearch.geometry.Rectangle> closeToFloat(org.elasticsearch.geometry.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(org.elasticsearch.geometry.Rectangle other)
      Specified by:
      matchesSafely in class org.hamcrest.TypeSafeMatcher<org.elasticsearch.geometry.Rectangle>
    • describeMismatchSafely

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

      public void describeTo(org.hamcrest.Description description)