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

    Constructors
    Constructor
    Description
    ReflectionEqualTo(T expected)
    Creates a new ReflectionEqualTo matcher with the expected value.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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

    Methods inherited from class java.lang.Object

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

    • ReflectionEqualTo

      public ReflectionEqualTo(T expected)
      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

      public boolean matchesSafely(T actual)
      Specified by:
      matchesSafely in class org.junit.internal.matchers.TypeSafeMatcher<T>
    • describeTo

      public void describeTo(org.hamcrest.Description description)