public class Equals extends ArgumentMatcher<Object> implements ContainsExtraTypeInformation, Serializable
Modifier and Type | Method and Description |
---|---|
String |
describe(Object object) |
void |
describeTo(org.hamcrest.Description description)
By default this method decamelizes matchers name to promote meaningful names for matchers.
|
boolean |
equals(Object o) |
protected Object |
getWanted() |
int |
hashCode() |
boolean |
matches(Object actual)
Returns whether this matcher accepts the given argument.
|
boolean |
typeMatches(Object object) |
org.hamcrest.SelfDescribing |
withExtraTypeInfo() |
public Equals(Object wanted)
public boolean matches(Object actual)
ArgumentMatcher
The method should never assert if the argument doesn't match. It should only return false.
matches
in interface org.hamcrest.Matcher<Object>
matches
in class ArgumentMatcher<Object>
actual
- the argumentBaseMatcher
public void describeTo(org.hamcrest.Description description)
ArgumentMatcher
For example StringWithStrongLanguage matcher will generate 'String with strong language' description in case of failure.
You might want to override this method to provide more specific description of the matcher (useful when verification failures are reported).
describeTo
in interface org.hamcrest.SelfDescribing
describeTo
in class ArgumentMatcher<Object>
description
- the description to which the matcher description is
appended.protected final Object getWanted()
public org.hamcrest.SelfDescribing withExtraTypeInfo()
withExtraTypeInfo
in interface ContainsExtraTypeInformation
public boolean typeMatches(Object object)
typeMatches
in interface ContainsExtraTypeInformation
Mockito, MIT License