|
1 |
| package com.agical.rmock.core.match.operator; |
|
2 |
| |
|
3 |
| import java.io.IOException; |
|
4 |
| |
|
5 |
| import com.agical.rmock.core.describe.ExpressionDescriber; |
|
6 |
| import com.agical.rmock.core.match.Expression; |
|
7 |
| import com.agical.rmock.core.match.Operator; |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| public class NotOperator extends AbstractExpression implements Operator { |
|
16 |
| |
|
17 |
| private final Expression wrappedConstraint; |
|
18 |
| |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
1243
| public NotOperator(Expression wrappedConstraint) {
|
|
23 |
1243
| this.wrappedConstraint = wrappedConstraint;
|
|
24 |
| } |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
555
| public boolean passes(Object object) {
|
|
30 |
555
| return !wrappedConstraint.passes(object);
|
|
31 |
| } |
|
32 |
| |
|
33 |
1
| public void describeWith(ExpressionDescriber constraintDescriber) throws IOException {
|
|
34 |
1
| constraintDescriber.describeInverted(wrappedConstraint);
|
|
35 |
| } |
|
36 |
| } |