1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.dynamic.sql.where.condition;
17
18 import java.util.function.BooleanSupplier;
19
20 import org.mybatis.dynamic.sql.AbstractNoValueCondition;
21
22 public class IsNotNull<T> extends AbstractNoValueCondition<T> implements AbstractNoValueCondition.Filterable {
23 private static final IsNotNull<?> EMPTY = new IsNotNull<>() {
24 @Override
25 public boolean isEmpty() {
26 return true;
27 }
28 };
29
30 public static <T> IsNotNull<T> empty() {
31 @SuppressWarnings("unchecked")
32 IsNotNull<T> t = (IsNotNull<T>) EMPTY;
33 return t;
34 }
35
36 public IsNotNull() {
37 super();
38 }
39
40 @Override
41 public String operator() {
42 return "is not null";
43 }
44
45 @Override
46 public <S> IsNotNull<S> filter(BooleanSupplier booleanSupplier) {
47 @SuppressWarnings("unchecked")
48 IsNotNull<S> self = (IsNotNull<S>) this;
49 return filterSupport(booleanSupplier, IsNotNull::empty, self);
50 }
51 }