1 /*
2 * MIT License
3 * Copyright (c) 2006-2025 JMockit developers
4 * See LICENSE file for full license text.
5 */
6 package mockit.internal.expectations.argumentMatching;
7
8 import edu.umd.cs.findbugs.annotations.NonNull;
9 import edu.umd.cs.findbugs.annotations.Nullable;
10
11 /**
12 * An argument matcher for the recording/verification of expectations.
13 */
14 public interface ArgumentMatcher<M extends ArgumentMatcher<M>> {
15 /**
16 * Indicates whether this matcher instance is functionally the same as another one of the same type.
17 */
18 boolean same(@NonNull M other);
19
20 /**
21 * Evaluates the matcher for the given argument.
22 */
23 boolean matches(@Nullable Object argValue);
24
25 /**
26 * Writes a phrase to be part of an error message describing an argument mismatch.
27 */
28 void writeMismatchPhrase(@NonNull ArgumentMismatch argumentMismatch);
29 }