Class Result

java.lang.Object
org.easymock.internal.Result
All Implemented Interfaces:
Serializable, IAnswer<Object>

public final class Result extends Object implements IAnswer<Object>, Serializable
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • value

      private final IAnswer<?> value
    • shouldFillInStackTrace

      private final boolean shouldFillInStackTrace
  • Constructor Details

    • Result

      private Result(IAnswer<?> value, boolean shouldFillInStackTrace)
  • Method Details

    • createThrowResult

      public static Result createThrowResult(Throwable throwable)
    • createReturnResult

      public static Result createReturnResult(Object value)
    • createDelegatingResult

      public static Result createDelegatingResult(Object value)
    • createAnswerResult

      public static Result createAnswerResult(IAnswer<?> answer)
    • answer

      public Object answer() throws Throwable
      Description copied from interface: IAnswer
      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.
      Specified by:
      answer in interface IAnswer<Object>
      Returns:
      the value to be returned
      Throws:
      Throwable - the throwable to be thrown
    • shouldFillInStackTrace

      public boolean shouldFillInStackTrace()
    • toString

      public String toString()
      Overrides:
      toString in class Object