public abstract class AbstractMatcher extends java.lang.Object implements ArgumentsMatcher
ArgumentsMatcher
. A subclass that
does not redefine any method will behave like
MockControl.EQUALS_MATCHER
.Constructor and Description |
---|
AbstractMatcher() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
argumentMatches(java.lang.Object expected,
java.lang.Object actual)
Compares two arguments; used by
matches(Object[], Object[]) . |
protected java.lang.String |
argumentToString(java.lang.Object argument)
Converts an argument to a String, used by
toString(Object[]) . |
boolean |
matches(java.lang.Object[] expected,
java.lang.Object[] actual)
Matches two arrays of arguments.
|
java.lang.String |
toString(java.lang.Object[] arguments)
Returns a string representation of the matcher.
|
protected boolean argumentMatches(java.lang.Object expected, java.lang.Object actual)
matches(Object[], Object[])
. The arguments
provided to this method are always not null
.expected
- the expected argument.actual
- the actual argument.protected java.lang.String argumentToString(java.lang.Object argument)
toString(Object[])
.argument
- the argument to convert to a String.String
representation of the argument.public boolean matches(java.lang.Object[] expected, java.lang.Object[] actual)
argumentMatches(Object, Object)
to check whether arguments
pairs match. If all the arguments match, true is returned, otherwise
false. In two cases, argumentMatches(Object, Object)
is
not called: If both argument arrays are null, they match; if one and only
one is null, they do not match.matches
in interface ArgumentsMatcher
expected
- the expected arguments.actual
- the actual arguments.public java.lang.String toString(java.lang.Object[] arguments)
argumentToString(Object)
for
every argument in the given array and returns the string representations
of the arguments separated by commas.toString
in interface ArgumentsMatcher
arguments
- the arguments to be used in the string representation.Copyright © 2001-2005 OFFIS. This documentation is provided under the terms of the MIT licence.