org.easymock
Class Capture<T>

java.lang.Object
  extended by org.easymock.Capture<T>
Type Parameters:
T - Type of the captured element
All Implemented Interfaces:
java.io.Serializable

public class Capture<T>
extends java.lang.Object
implements java.io.Serializable

Will contain what was captured by the capture() matcher. Knows if something was captured or not (allows to capture a null value).

See Also:
Serialized Form

Constructor Summary
Capture()
           
 
Method Summary
 T getValue()
          Return the captured value
 boolean hasCaptured()
           
 void reset()
          Will reset capture to a "nothing captured yet" state
 void setValue(T value)
          Used internally by the EasyMock framework to set the captured value
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Capture

public Capture()
Method Detail

reset

public void reset()
Will reset capture to a "nothing captured yet" state


hasCaptured

public boolean hasCaptured()
Returns:
true if something was captured

getValue

public T getValue()
Return the captured value

Returns:
What was captured
Throws:
java.lang.AssertionError - if nothing was captured yet

setValue

public void setValue(T value)
Used internally by the EasyMock framework to set the captured value

Parameters:
value - Value captured

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright 2001-2008 OFFIS, Tammo Freese. This documentation is provided under the terms of the MIT licence.