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