Top Description Fields Constructors Methods
org.easymock.internal.matchers

public abstract Class CompareTo<T extends Comparable<T>>

extends Object
implements IArgumentMatcher, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.easymock.IArgumentMatcher
Known Direct Subclasses
org.easymock.internal.matchers.GreaterOrEqual, org.easymock.internal.matchers.GreaterThan, org.easymock.internal.matchers.LessOrEqual, org.easymock.internal.matchers.LessThan, org.easymock.internal.matchers.CompareEqual
Type Parameters
<T>
Type of the values compared
Imports
java.io.Serializable, org.easymock.IArgumentMatcher

Base class for matchers that are comparing a value to another.
Author
Henri Tremblay

Field Summary

Modifier and TypeField and Description
private final Comparable<T>
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Implements org.easymock.IArgumentMatcher.appendTo.

Appends a string representation of this matcher to the given buffer.
protected abstract String
public boolean
matches(Object
the argument
actual
)

Implements org.easymock.IArgumentMatcher.matches.

Returns whether this matcher accepts the given argument.
protected abstract boolean
matchResult(int result)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

expectedback to summary
private final Comparable<T> expected
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

CompareToback to summary
public CompareTo(Comparable<T> value)

Method Detail

appendToback to summary
public void appendTo(StringBuffer buffer)

Implements org.easymock.IArgumentMatcher.appendTo.

Doc from org.easymock.IArgumentMatcher.appendTo.

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.

Annotations
@Override
getNameback to summary
protected abstract String getName()
matchesback to summary
public boolean matches(Object actual)

Implements org.easymock.IArgumentMatcher.matches.

Doc from org.easymock.IArgumentMatcher.matches.

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
actual:Object

the argument

Returns:boolean

whether this matcher accepts the given argument.

Annotations
@SuppressWarnings:unchecked, rawtypes
matchResultback to summary
protected abstract boolean matchResult(int result)