Top Description Fields Constructors Methods
org.easymock.internal

public final Class Result

extends Object
implements IAnswer<Object>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.easymock.IAnswer
Imports
org.easymock.IAnswer, java.io.Serializable, java.lang.reflect.Array, .InvocationTargetException, .Method

The result of an invocation on a mock. It can be a direct constant or the result of some computation.
Author
OFFIS, Tammo Freese

Field Summary

Modifier and TypeField and Description
private static final long
private final boolean
private final IAnswer<?>

Constructor Summary

AccessConstructor and Description
private
Result(IAnswer<?> value, boolean shouldFillInStackTrace)

Method Summary

Modifier and TypeMethod and Description
public Object
answer()

Implements org.easymock.IAnswer.answer.

Is called by EasyMock to answer an expected call.
public static Result
public static Result
public static Result
public static Result
createThrowResult(final Throwable throwable)

public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID
shouldFillInStackTraceback to summary
private final boolean shouldFillInStackTrace
valueback to summary
private final IAnswer<?> value

Constructor Detail

Resultback to summary
private Result(IAnswer<?> value, boolean shouldFillInStackTrace)

Method Detail

answerback to summary
public Object answer() throws Throwable

Implements org.easymock.IAnswer.answer.

Doc from org.easymock.IAnswer.answer.

Is called by EasyMock to answer an expected call. The answer may be to return a value, or to throw an exception. The arguments of the call for which the answer is generated are available via EasyMock#getCurrentArgument(int) or EasyMock#getCurrentArguments(). The former method is preferred since it will infer the argument type.

Returns:Object

the value to be returned

Exceptions
Throwable:
the throwable to be thrown
createAnswerResultback to summary
public static Result createAnswerResult(IAnswer<?> answer)
createDelegatingResultback to summary
public static Result createDelegatingResult(final Object value)
createReturnResultback to summary
public static Result createReturnResult(final Object value)
createThrowResultback to summary
public static Result createThrowResult(final Throwable throwable)
shouldFillInStackTraceback to summary
public boolean shouldFillInStackTrace()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override