public class MatcherApplicationStrategy
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
MatcherApplicationStrategy.MatcherApplicationType |
Modifier and Type | Field and Description |
---|---|
private Invocation |
invocation |
private java.util.List<ArgumentMatcher<?>> |
matchers |
private MatcherApplicationStrategy.MatcherApplicationType |
matchingType |
Modifier | Constructor and Description |
---|---|
private |
MatcherApplicationStrategy(Invocation invocation,
java.util.List<ArgumentMatcher<?>> matchers,
MatcherApplicationStrategy.MatcherApplicationType matchingType) |
Modifier and Type | Method and Description |
---|---|
private static java.util.List<ArgumentMatcher<?>> |
appendLastMatcherNTimes(java.util.List<ArgumentMatcher<?>> matchers,
int timesToAppendLastMatcher) |
boolean |
forEachMatcherAndArgument(ArgumentMatcherAction action)
Applies the given
ArgumentMatcherAction to all arguments and
corresponding matchers |
static MatcherApplicationStrategy |
getMatcherApplicationStrategyFor(Invocation invocation,
java.util.List<ArgumentMatcher<?>> matchers)
Returns the
MatcherApplicationStrategy that must be used to capture the
arguments of the given invocation using the given matchers. |
private static MatcherApplicationStrategy.MatcherApplicationType |
getMatcherApplicationType(Invocation invocation,
java.util.List<ArgumentMatcher<?>> matchers) |
private static boolean |
isLastMatcherVarargMatcher(java.util.List<ArgumentMatcher<?>> matchers) |
private static ArgumentMatcher<?> |
lastMatcher(java.util.List<ArgumentMatcher<?>> matchers) |
private static int |
varargLength(Invocation invocation) |
private final Invocation invocation
private final java.util.List<ArgumentMatcher<?>> matchers
private final MatcherApplicationStrategy.MatcherApplicationType matchingType
private MatcherApplicationStrategy(Invocation invocation, java.util.List<ArgumentMatcher<?>> matchers, MatcherApplicationStrategy.MatcherApplicationType matchingType)
public static MatcherApplicationStrategy getMatcherApplicationStrategyFor(Invocation invocation, java.util.List<ArgumentMatcher<?>> matchers)
MatcherApplicationStrategy
that must be used to capture the
arguments of the given invocation using the given matchers.invocation
- that contain the arguments to capturematchers
- that will be used to capture the arguments of the invocation,
the passed List
is not required to contain a
CapturingMatcher
null
public boolean forEachMatcherAndArgument(ArgumentMatcherAction action)
ArgumentMatcherAction
to all arguments and
corresponding matchersaction
- must not be null
true
if the given action returned
true
for all arguments and matchers passed to it.
false
if the given action returned
false
for one of the passed arguments and matchers
false
if the given matchers don't fit to the given invocation
because too many or to few matchers are available.
private static MatcherApplicationStrategy.MatcherApplicationType getMatcherApplicationType(Invocation invocation, java.util.List<ArgumentMatcher<?>> matchers)
private static boolean isLastMatcherVarargMatcher(java.util.List<ArgumentMatcher<?>> matchers)
private static java.util.List<ArgumentMatcher<?>> appendLastMatcherNTimes(java.util.List<ArgumentMatcher<?>> matchers, int timesToAppendLastMatcher)
private static int varargLength(Invocation invocation)
private static ArgumentMatcher<?> lastMatcher(java.util.List<ArgumentMatcher<?>> matchers)