Package org.mockito.internal.matchers
Class Equals
java.lang.Object
org.mockito.internal.matchers.Equals
- All Implemented Interfaces:
Serializable
,ArgumentMatcher<Object>
,ContainsExtraTypeInfo
- Direct Known Subclasses:
ArrayEquals
public class Equals
extends Object
implements ArgumentMatcher<Object>, ContainsExtraTypeInfo, Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
boolean
final Object
int
hashCode()
boolean
Informs if this matcher accepts the given argument.toString()
toStringWithType
(String className) boolean
typeMatches
(Object target) Checks if target target has matching type.
-
Field Details
-
wanted
-
-
Constructor Details
-
Equals
-
-
Method Details
-
matches
Description copied from interface:ArgumentMatcher
Informs if this matcher accepts the given argument.The method should never assert if the argument doesn't match. It should only return false.
See the example in the top level javadoc for
ArgumentMatcher
- Specified by:
matches
in interfaceArgumentMatcher<Object>
- Parameters:
actual
- the argument- Returns:
- true if this matcher accepts the given argument.
-
toString
-
describe
-
getWanted
- Specified by:
getWanted
in interfaceContainsExtraTypeInfo
- Returns:
- Returns the wanted argument
-
equals
-
hashCode
public int hashCode() -
toStringWithType
- Specified by:
toStringWithType
in interfaceContainsExtraTypeInfo
- Parameters:
className
- - name of the class to be printed in description Returns more verbose description of the object which include type information
-
typeMatches
Description copied from interface:ContainsExtraTypeInfo
Checks if target target has matching type. If the type matches, there is no point in rendering result fromContainsExtraTypeInfo.toStringWithType(String)
- Specified by:
typeMatches
in interfaceContainsExtraTypeInfo
-