Package org.elasticsearch.test.hamcrest
Class RectangleMatcher
- All Implemented Interfaces:
org.hamcrest.Matcher<Rectangle>,org.hamcrest.SelfDescribing
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 TypeMethodDescriptionstatic org.hamcrest.TypeSafeMatcher<Rectangle> closeTo(Rectangle r, double error, CoordinateEncoder coordinateEncoder) static org.hamcrest.TypeSafeMatcher<Rectangle> closeToFloat(Rectangle r, double v, CoordinateEncoder encoder) Casts the rectangle coordinates to floats before comparing.voiddescribeMismatchSafely(Rectangle rectangle, org.hamcrest.Description description) voiddescribeTo(org.hamcrest.Description description) protected booleanmatchesSafely(Rectangle other) Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, matchesMethods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
-
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
- Specified by:
matchesSafelyin classorg.hamcrest.TypeSafeMatcher<Rectangle>
-
describeMismatchSafely
- Overrides:
describeMismatchSafelyin classorg.hamcrest.TypeSafeMatcher<Rectangle>
-
describeTo
public void describeTo(org.hamcrest.Description description)
-