Top Description Methods
org.easymock

public Interface IArgumentMatcher

Known Direct Implementers
org.easymock.internal.matchers.And, org.easymock.internal.matchers.Any, org.easymock.internal.matchers.Captures, org.easymock.internal.matchers.Compare, org.easymock.internal.matchers.CompareTo, org.easymock.internal.matchers.Contains, org.easymock.internal.matchers.EndsWith, org.easymock.internal.matchers.Equals, org.easymock.internal.matchers.EqualsWithDelta, org.easymock.internal.matchers.Find, org.easymock.internal.matchers.InstanceOf, org.easymock.internal.matchers.Matches, org.easymock.internal.matchers.Not, org.easymock.internal.matchers.NotNull, org.easymock.internal.matchers.Null, org.easymock.internal.matchers.Or, org.easymock.internal.matchers.Same, org.easymock.internal.matchers.StartsWith

Decides whether an actual argument is accepted.
Author
OFFIS, Tammo Freese

Method Summary

Modifier and TypeMethod and Description
public void
appendTo(StringBuffer
the buffer to which the string representation is appended.
buffer
)

Appends a string representation of this matcher to the given buffer.

public boolean

Returns:

whether this matcher accepts the given argument.
matches
(Object
the argument
argument
)

Returns whether this matcher accepts the given argument.

Method Detail

appendToback to summary
public void appendTo(StringBuffer buffer)

Appends a string representation of this matcher to the given buffer. In case of failure, the printed message will show this string to allow to know which matcher was used for the failing call.

Parameters
buffer:StringBuffer

the buffer to which the string representation is appended.

matchesback to summary
public boolean matches(Object argument)

Returns whether this matcher accepts the given argument.

Like Object.equals(), it should be aware that the argument passed might be null and of any type. So you will usually start the method with an instanceof and/or null check.

The method should never assert if the argument doesn't match. It should only return false. EasyMock will take care of asserting if the call is really unexpected.

Parameters
argument:Object

the argument

Returns:boolean

whether this matcher accepts the given argument.