Package org.mockito.internal.matchers
Class Equals
- java.lang.Object
-
- org.mockito.internal.matchers.Equals
-
- All Implemented Interfaces:
java.io.Serializable,ArgumentMatcher<java.lang.Object>,ContainsExtraTypeInfo
- Direct Known Subclasses:
ArrayEquals
public class Equals extends java.lang.Object implements ArgumentMatcher<java.lang.Object>, ContainsExtraTypeInfo, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Objectwanted
-
Constructor Summary
Constructors Constructor Description Equals(java.lang.Object wanted)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.Stringdescribe(java.lang.Object object)booleanequals(java.lang.Object o)java.lang.ObjectgetWanted()inthashCode()booleanmatches(java.lang.Object actual)Informs if this matcher accepts the given argument.java.lang.StringtoString()java.lang.StringtoStringWithType(java.lang.String className)booleantypeMatches(java.lang.Object target)Checks if target target has matching type.
-
-
-
Method Detail
-
matches
public boolean matches(java.lang.Object actual)
Description copied from interface:ArgumentMatcherInforms 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:
matchesin interfaceArgumentMatcher<java.lang.Object>- Parameters:
actual- the argument- Returns:
- true if this matcher accepts the given argument.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
describe
private java.lang.String describe(java.lang.Object object)
-
getWanted
public final java.lang.Object getWanted()
- Specified by:
getWantedin interfaceContainsExtraTypeInfo- Returns:
- Returns the wanted argument
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toStringWithType
public java.lang.String toStringWithType(java.lang.String className)
- Specified by:
toStringWithTypein interfaceContainsExtraTypeInfo- Parameters:
className- - name of the class to be printed in description Returns more verbose description of the object which include type information
-
typeMatches
public boolean typeMatches(java.lang.Object target)
Description copied from interface:ContainsExtraTypeInfoChecks if target target has matching type. If the type matches, there is no point in rendering result fromContainsExtraTypeInfo.toStringWithType(String)- Specified by:
typeMatchesin interfaceContainsExtraTypeInfo
-
-