12637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin/*
22637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin * Copyright (c) 2016 Mockito contributors
32637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin * This program is made available under the terms of the MIT License.
42637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin */
52637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffinpackage org.mockito.internal.invocation;
62637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin
72637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffinimport org.mockito.ArgumentMatcher;
82637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin
92637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffinpublic interface ArgumentMatcherAction {
102637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin    /**
112637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * Implementations must apply the given matcher to the argument and return
122637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * <code>true</code> if the operation was successful or <code>false</code>
132637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * if not. In this case no more matchers and arguments will be passed by
142637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * {@link MatcherApplicationStrategy#forEachMatcherAndArgument(ArgumentMatcherAction)} to this method.
152637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * .
162637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *
172637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * @param matcher
182637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *            to process the argument, never <code>null</code>
192637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * @param argument
202637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *            to be processed by the matcher, can be <code>null</code>
212637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     * @return
222637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *         <ul>
232637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *         <li><code>true</code> if the <b>matcher</b> was successfully
242637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *         applied to the <b>argument</b> and the next pair of matcher and
252637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *         argument should be passed
262637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *         <li><code>false</code> otherwise
272637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *         </ul>
282637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *
292637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     *
302637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin     */
312637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin    boolean apply(ArgumentMatcher<?> matcher, Object argument);
322637d96c202372854a7c71466ddcc6e90fc4fc53Paul Duffin}
33