• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2007 Mockito contributors
3  * This program is made available under the terms of the MIT License.
4  */
5 
6 package org.mockito.internal.matchers;
7 
8 import org.mockito.ArgumentMatcher;
9 
10 import java.io.Serializable;
11 
12 @SuppressWarnings({ "unchecked", "serial","rawtypes" })
13 public class Not implements ArgumentMatcher<Object>, Serializable {
14 
15     private final ArgumentMatcher matcher;
16 
Not(ArgumentMatcher<?> matcher)17     public Not(ArgumentMatcher<?> matcher) {
18         this.matcher = matcher;
19     }
20 
matches(Object actual)21     public boolean matches(Object actual) {
22         return !matcher.matches(actual);
23     }
24 
toString()25     public String toString() {
26         return "not(" + matcher + ")";
27     }
28 }
29