T
- The type of object to match.public class DeepEqualsMatcher<T>
extends org.hamcrest.BaseMatcher<T>
BaseMatcher
implementation that first matches based on Object.equals(Object)
. When this fails and
equals()
is not overridden from Object
by T
, the instance's field values are checked for
equality. If this fails due to inaccessibility of the class or its fields, this matcher will not match.Constructor and Description |
---|
DeepEqualsMatcher(T expected)
|
DeepEqualsMatcher(T expected,
FieldFilter filter)
|
Modifier and Type | Method and Description |
---|---|
void |
describeTo(org.hamcrest.Description description) |
boolean |
matches(Object actual) |
public DeepEqualsMatcher(T expected)
expected
- The object to match with during matches(Object)
.public DeepEqualsMatcher(T expected, FieldFilter filter)
expected
- The object to match with during matches(Object)
.filter
- The filter describing the fields to include or exclude in the comparison.public boolean matches(Object actual)
public void describeTo(org.hamcrest.Description description)
Copyright © 2010–2023. All rights reserved.