Class MatcherApplicationStrategy


  • public class MatcherApplicationStrategy
    extends java.lang.Object
    • Field Detail

      • 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 the MatcherApplicationStrategy that must be used to capture the arguments of the given invocation using the given matchers.
        Parameters:
        invocation - that contain the arguments to capture
        matchers - that will be used to capture the arguments of the invocation, the passed List is not required to contain a CapturingMatcher
        Returns:
        never null
      • forEachMatcherAndArgument

        public boolean forEachMatcherAndArgument​(ArgumentMatcherAction action)
        Applies the given ArgumentMatcherAction to all arguments and corresponding matchers
        Parameters:
        action - must not be null
        Returns:
        • 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.
      • lastMatcherType

        private java.lang.Class<?> lastMatcherType()
      • lastParameterType

        private java.lang.Class<?> lastParameterType()