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 IsNull<T> extends AbstractNoValueCondition<T> implements AbstractNoValueCondition.Filterable {
23 private static final IsNull<?> EMPTY = new IsNull<>() {
24 @Override
25 public boolean isEmpty() {
26 return true;
27 }
28 };
29
30 public static <T> IsNull<T> empty() {
31 @SuppressWarnings("unchecked")
32 IsNull<T> t = (IsNull<T>) EMPTY;
33 return t;
34 }
35
36 public IsNull() {
37 super();
38 }
39
40 @Override
41 public String operator() {
42 return "is null";
43 }
44
45 @Override
46 public <S> IsNull<S> filter(BooleanSupplier booleanSupplier) {
47 @SuppressWarnings("unchecked")
48 IsNull<S> self = (IsNull<S>) this;
49 return filterSupport(booleanSupplier, IsNull::empty, self);
50 }
51 }