Package org.mockito.internal.invocation
Class MatcherApplicationStrategy
- java.lang.Object
-
- org.mockito.internal.invocation.MatcherApplicationStrategy
-
public class MatcherApplicationStrategy extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private Invocationinvocationprivate java.util.List<? extends ArgumentMatcher<?>>matchers
-
Constructor Summary
Constructors Modifier Constructor Description privateMatcherApplicationStrategy(Invocation invocation, java.util.List<? extends ArgumentMatcher<?>> matchers)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanargsMatch(java.lang.Object[] arguments, java.util.List<? extends ArgumentMatcher<?>> matchers, ArgumentMatcherAction action)booleanforEachMatcherAndArgument(ArgumentMatcherAction action)Applies the givenArgumentMatcherActionto all arguments and corresponding matchersstatic MatcherApplicationStrategygetMatcherApplicationStrategyFor(Invocation invocation, java.util.List<? extends ArgumentMatcher<?>> matchers)Returns theMatcherApplicationStrategythat must be used to capture the arguments of the given invocation using the given matchers.private java.lang.Class<?>lastMatcherType()private java.lang.Class<?>lastParameterType()
-
-
-
Field Detail
-
invocation
private final Invocation invocation
-
matchers
private final java.util.List<? extends ArgumentMatcher<?>> matchers
-
-
Constructor Detail
-
MatcherApplicationStrategy
private MatcherApplicationStrategy(Invocation invocation, java.util.List<? extends ArgumentMatcher<?>> matchers)
-
-
Method Detail
-
getMatcherApplicationStrategyFor
public static MatcherApplicationStrategy getMatcherApplicationStrategyFor(Invocation invocation, java.util.List<? extends ArgumentMatcher<?>> matchers)
Returns theMatcherApplicationStrategythat must be used to capture the arguments of the given invocation using the given matchers.- Parameters:
invocation- that contain the arguments to capturematchers- that will be used to capture the arguments of the invocation, the passedListis not required to contain aCapturingMatcher- Returns:
- never
null
-
forEachMatcherAndArgument
public boolean forEachMatcherAndArgument(ArgumentMatcherAction action)
Applies the givenArgumentMatcherActionto all arguments and corresponding matchers- Parameters:
action- must not benull- Returns:
trueif the given action returnedtruefor all arguments and matchers passed to it.falseif the given action returnedfalsefor one of the passed arguments and matchersfalseif the given matchers don't fit to the given invocation because too many or to few matchers are available.
-
argsMatch
private boolean argsMatch(java.lang.Object[] arguments, java.util.List<? extends ArgumentMatcher<?>> matchers, ArgumentMatcherAction action)
-
lastMatcherType
private java.lang.Class<?> lastMatcherType()
-
lastParameterType
private java.lang.Class<?> lastParameterType()
-
-