Package com.atlassian.jira.matchers
Class ReflectionEqualTo<T>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.junit.internal.matchers.TypeSafeMatcher<T>
com.atlassian.jira.matchers.ReflectionEqualTo<T>
- All Implemented Interfaces:
org.hamcrest.Matcher<T>
,org.hamcrest.SelfDescribing
public class ReflectionEqualTo<T>
extends org.junit.internal.matchers.TypeSafeMatcher<T>
Matcher that uses
EqualsBuilder.reflectionAppend(Object, Object)
instead of a
class's equals(Object) implementation.- Since:
- v4.4
-
Constructor Summary
ConstructorsConstructorDescriptionReflectionEqualTo
(T expected) Creates a new ReflectionEqualTo matcher with the expected value. -
Method Summary
Modifier and TypeMethodDescriptionvoid
describeTo
(org.hamcrest.Description description) boolean
matchesSafely
(T actual) static <T> org.hamcrest.Matcher
<T> reflectionEqualTo
(T expected) Matcher that compares objects using reflection.Methods inherited from class org.junit.internal.matchers.TypeSafeMatcher
matches
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString
-
Constructor Details
-
ReflectionEqualTo
Creates a new ReflectionEqualTo matcher with the expected value.- Parameters:
expected
- the expected value
-
-
Method Details
-
reflectionEqualTo
public static <T> org.hamcrest.Matcher<T> reflectionEqualTo(T expected) Matcher that compares objects using reflection.- Parameters:
expected
- the expected object- Returns:
- a Matcher
-
matchesSafely
- Specified by:
matchesSafely
in classorg.junit.internal.matchers.TypeSafeMatcher<T>
-
describeTo
public void describeTo(org.hamcrest.Description description)
-