public class CapturingMatcher<T> extends Object implements ArgumentMatcher<T>, CapturesArguments, VarargMatcher, Serializable
Constructor and Description |
---|
CapturingMatcher() |
Modifier and Type | Method and Description |
---|---|
void |
captureFrom(Object argument) |
List<T> |
getAllValues() |
T |
getLastValue() |
boolean |
matches(Object argument)
Informs if this matcher accepts the given argument.
|
String |
toString() |
public boolean matches(Object argument)
ArgumentMatcher
The method should never assert if the argument doesn't match. It should only return false.
The argument is not using generic type in order to force explicit casting in the implementation. This way it is easier to debug when incompatible arguments are passed to the matchers. You have to trust us on this one. //TODO SF make sure it makes sense to receive an Object here instead of T and document it.
See the example in the top level javadoc for ArgumentMatcher
matches
in interface ArgumentMatcher<T>
argument
- the argumentpublic T getLastValue()
public void captureFrom(Object argument)
captureFrom
in interface CapturesArguments