public class CapturingMatcher<T> extends ArgumentMatcher<T> implements CapturesArguments, VarargMatcher, Serializable
Constructor and Description |
---|
CapturingMatcher() |
Modifier and Type | Method and Description |
---|---|
void |
captureFrom(Object argument) |
void |
describeTo(org.hamcrest.Description description)
By default this method decamelizes matchers name to promote meaningful names for matchers.
|
List<T> |
getAllValues() |
T |
getLastValue() |
boolean |
matches(Object argument)
Returns whether this matcher accepts the given argument.
|
public boolean matches(Object argument)
ArgumentMatcher
The method should never assert if the argument doesn't match. It should only return false.
matches
in interface org.hamcrest.Matcher<T>
matches
in class ArgumentMatcher<T>
argument
- the argumentBaseMatcher
public void describeTo(org.hamcrest.Description description)
ArgumentMatcher
For example StringWithStrongLanguage matcher will generate 'String with strong language' description in case of failure.
You might want to override this method to provide more specific description of the matcher (useful when verification failures are reported).
describeTo
in interface org.hamcrest.SelfDescribing
describeTo
in class ArgumentMatcher<T>
description
- the description to which the matcher description is
appended.public T getLastValue()
public void captureFrom(Object argument)
captureFrom
in interface CapturesArguments
Mockito, MIT License