Package org.mockito.internal.matchers
Class Equals
- java.lang.Object
-
- org.hamcrest.BaseMatcher<T>
-
- org.mockito.ArgumentMatcher<java.lang.Object>
-
- org.mockito.internal.matchers.Equals
-
- All Implemented Interfaces:
java.io.Serializable,org.hamcrest.Matcher<java.lang.Object>,org.hamcrest.SelfDescribing,ContainsExtraTypeInformation
- Direct Known Subclasses:
ArrayEquals
public class Equals extends ArgumentMatcher<java.lang.Object> implements ContainsExtraTypeInformation, java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Equals(java.lang.Object wanted)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringdescribe(java.lang.Object object)voiddescribeTo(org.hamcrest.Description description)By default this method decamelizes matchers name to promote meaningful names for matchers.booleanequals(java.lang.Object o)protected java.lang.ObjectgetWanted()inthashCode()booleanmatches(java.lang.Object actual)Returns whether this matcher accepts the given argument.booleantypeMatches(java.lang.Object object)org.hamcrest.SelfDescribingwithExtraTypeInfo()
-
-
-
Method Detail
-
matches
public boolean matches(java.lang.Object actual)
Description copied from class:ArgumentMatcherReturns whether this matcher accepts the given argument.The method should never assert if the argument doesn't match. It should only return false.
- Specified by:
matchesin interfaceorg.hamcrest.Matcher<java.lang.Object>- Specified by:
matchesin classArgumentMatcher<java.lang.Object>- Parameters:
actual- the argument- Returns:
- whether this matcher accepts the given argument.
-
describeTo
public void describeTo(org.hamcrest.Description description)
Description copied from class:ArgumentMatcherBy default this method decamelizes matchers name to promote meaningful names for matchers.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).
- Specified by:
describeToin interfaceorg.hamcrest.SelfDescribing- Overrides:
describeToin classArgumentMatcher<java.lang.Object>- Parameters:
description- the description to which the matcher description is appended.
-
describe
public java.lang.String describe(java.lang.Object object)
-
getWanted
protected final java.lang.Object getWanted()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
withExtraTypeInfo
public org.hamcrest.SelfDescribing withExtraTypeInfo()
- Specified by:
withExtraTypeInfoin interfaceContainsExtraTypeInformation
-
typeMatches
public boolean typeMatches(java.lang.Object object)
- Specified by:
typeMatchesin interfaceContainsExtraTypeInformation
-
-