View Javadoc
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  public final class InequalityMatcher extends EqualityMatcher {
11      public InequalityMatcher(@Nullable Object notEqualArg) {
12          super(notEqualArg);
13      }
14  
15      @Override
16      public boolean matches(@Nullable Object argValue) {
17          return !super.matches(argValue);
18      }
19  
20      @Override
21      public void writeMismatchPhrase(@NonNull ArgumentMismatch argumentMismatch) {
22          argumentMismatch.append("not ").appendFormatted(object);
23      }
24  }