22
33import java .util .Collections ;
44import java .util .List ;
5+ import java .util .Objects ;
56import org .seasar .doma .jdbc .criteria .option .LikeOption ;
67import org .seasar .doma .jdbc .criteria .tuple .Tuple2 ;
78
@@ -13,8 +14,8 @@ class Eq implements Criterion {
1314 public final Operand right ;
1415
1516 public Eq (Operand .Prop left , Operand right ) {
16- this .left = left ;
17- this .right = right ;
17+ this .left = Objects . requireNonNull ( left ) ;
18+ this .right = Objects . requireNonNull ( right ) ;
1819 }
1920
2021 @ Override
@@ -28,8 +29,8 @@ class Ne implements Criterion {
2829 public final Operand right ;
2930
3031 public Ne (Operand .Prop left , Operand right ) {
31- this .left = left ;
32- this .right = right ;
32+ this .left = Objects . requireNonNull ( left ) ;
33+ this .right = Objects . requireNonNull ( right ) ;
3334 }
3435
3536 @ Override
@@ -43,8 +44,8 @@ class Gt implements Criterion {
4344 public final Operand right ;
4445
4546 public Gt (Operand .Prop left , Operand right ) {
46- this .left = left ;
47- this .right = right ;
47+ this .left = Objects . requireNonNull ( left ) ;
48+ this .right = Objects . requireNonNull ( right ) ;
4849 }
4950
5051 @ Override
@@ -58,8 +59,8 @@ class Ge implements Criterion {
5859 public final Operand right ;
5960
6061 public Ge (Operand .Prop left , Operand right ) {
61- this .left = left ;
62- this .right = right ;
62+ this .left = Objects . requireNonNull ( left ) ;
63+ this .right = Objects . requireNonNull ( right ) ;
6364 }
6465
6566 @ Override
@@ -73,8 +74,8 @@ class Lt implements Criterion {
7374 public final Operand right ;
7475
7576 public Lt (Operand .Prop left , Operand right ) {
76- this .left = left ;
77- this .right = right ;
77+ this .left = Objects . requireNonNull ( left ) ;
78+ this .right = Objects . requireNonNull ( right ) ;
7879 }
7980
8081 @ Override
@@ -88,8 +89,8 @@ class Le implements Criterion {
8889 public final Operand right ;
8990
9091 public Le (Operand .Prop left , Operand right ) {
91- this .left = left ;
92- this .right = right ;
92+ this .left = Objects . requireNonNull ( left ) ;
93+ this .right = Objects . requireNonNull ( right ) ;
9394 }
9495
9596 @ Override
@@ -102,7 +103,7 @@ class IsNull implements Criterion {
102103 public final Operand .Prop prop ;
103104
104105 public IsNull (Operand .Prop prop ) {
105- this .prop = prop ;
106+ this .prop = Objects . requireNonNull ( prop ) ;
106107 }
107108
108109 @ Override
@@ -115,7 +116,7 @@ class IsNotNull implements Criterion {
115116 public final Operand .Prop prop ;
116117
117118 public IsNotNull (Operand .Prop prop ) {
118- this .prop = prop ;
119+ this .prop = Objects . requireNonNull ( prop ) ;
119120 }
120121
121122 @ Override
@@ -130,9 +131,9 @@ class Like implements Criterion {
130131 public final LikeOption option ;
131132
132133 public Like (Operand .Prop left , Operand right , LikeOption option ) {
133- this .left = left ;
134- this .right = right ;
135- this .option = option ;
134+ this .left = Objects . requireNonNull ( left ) ;
135+ this .right = Objects . requireNonNull ( right ) ;
136+ this .option = Objects . requireNonNull ( option ) ;
136137 }
137138
138139 @ Override
@@ -147,9 +148,9 @@ class NotLike implements Criterion {
147148 public final LikeOption option ;
148149
149150 public NotLike (Operand .Prop left , Operand right , LikeOption option ) {
150- this .left = left ;
151- this .right = right ;
152- this .option = option ;
151+ this .left = Objects . requireNonNull ( left ) ;
152+ this .right = Objects . requireNonNull ( right ) ;
153+ this .option = Objects . requireNonNull ( option ) ;
153154 }
154155
155156 @ Override
@@ -164,9 +165,9 @@ class Between implements Criterion {
164165 public final Operand .Param end ;
165166
166167 public Between (Operand .Prop prop , Operand .Param start , Operand .Param end ) {
167- this .prop = prop ;
168- this .start = start ;
169- this .end = end ;
168+ this .prop = Objects . requireNonNull ( prop ) ;
169+ this .start = Objects . requireNonNull ( start ) ;
170+ this .end = Objects . requireNonNull ( end ) ;
170171 }
171172
172173 @ Override
@@ -180,8 +181,8 @@ class In implements Criterion {
180181 public final List <Operand .Param > right ;
181182
182183 public In (Operand .Prop left , List <Operand .Param > right ) {
183- this .left = left ;
184- this .right = right ;
184+ this .left = Objects . requireNonNull ( left ) ;
185+ this .right = Objects . requireNonNull ( right ) ;
185186 }
186187
187188 @ Override
@@ -195,8 +196,8 @@ class NotIn implements Criterion {
195196 public final List <Operand .Param > right ;
196197
197198 public NotIn (Operand .Prop left , List <Operand .Param > right ) {
198- this .left = left ;
199- this .right = right ;
199+ this .left = Objects . requireNonNull ( left ) ;
200+ this .right = Objects . requireNonNull ( right ) ;
200201 }
201202
202203 @ Override
@@ -210,8 +211,8 @@ class InSubQuery implements Criterion {
210211 public final SelectContext right ;
211212
212213 public InSubQuery (Operand .Prop left , SelectContext right ) {
213- this .left = left ;
214- this .right = right ;
214+ this .left = Objects . requireNonNull ( left ) ;
215+ this .right = Objects . requireNonNull ( right ) ;
215216 }
216217
217218 @ Override
@@ -225,8 +226,8 @@ class NotInSubQuery implements Criterion {
225226 public final SelectContext right ;
226227
227228 public NotInSubQuery (Operand .Prop left , SelectContext right ) {
228- this .left = left ;
229- this .right = right ;
229+ this .left = Objects . requireNonNull ( left ) ;
230+ this .right = Objects . requireNonNull ( right ) ;
230231 }
231232
232233 @ Override
@@ -241,8 +242,8 @@ class InTuple2 implements Criterion {
241242
242243 public InTuple2 (
243244 Tuple2 <Operand .Prop , Operand .Prop > left , List <Tuple2 <Operand .Param , Operand .Param >> right ) {
244- this .left = left ;
245- this .right = right ;
245+ this .left = Objects . requireNonNull ( left ) ;
246+ this .right = Objects . requireNonNull ( right ) ;
246247 }
247248
248249 @ Override
@@ -257,8 +258,8 @@ class NotInTuple2 implements Criterion {
257258
258259 public NotInTuple2 (
259260 Tuple2 <Operand .Prop , Operand .Prop > left , List <Tuple2 <Operand .Param , Operand .Param >> right ) {
260- this .left = left ;
261- this .right = right ;
261+ this .left = Objects . requireNonNull ( left ) ;
262+ this .right = Objects . requireNonNull ( right ) ;
262263 }
263264
264265 @ Override
@@ -272,8 +273,8 @@ class InTuple2SubQuery implements Criterion {
272273 public final SelectContext right ;
273274
274275 public InTuple2SubQuery (Tuple2 <Operand .Prop , Operand .Prop > left , SelectContext right ) {
275- this .left = left ;
276- this .right = right ;
276+ this .left = Objects . requireNonNull ( left ) ;
277+ this .right = Objects . requireNonNull ( right ) ;
277278 }
278279
279280 @ Override
@@ -287,8 +288,8 @@ class NotInTuple2SubQuery implements Criterion {
287288 public final SelectContext right ;
288289
289290 public NotInTuple2SubQuery (Tuple2 <Operand .Prop , Operand .Prop > left , SelectContext right ) {
290- this .left = left ;
291- this .right = right ;
291+ this .left = Objects . requireNonNull ( left ) ;
292+ this .right = Objects . requireNonNull ( right ) ;
292293 }
293294
294295 @ Override
@@ -301,7 +302,7 @@ class Exists implements Criterion {
301302 public final SelectContext context ;
302303
303304 public Exists (SelectContext context ) {
304- this .context = context ;
305+ this .context = Objects . requireNonNull ( context ) ;
305306 }
306307
307308 @ Override
@@ -314,7 +315,7 @@ class NotExists implements Criterion {
314315 public final SelectContext context ;
315316
316317 public NotExists (SelectContext context ) {
317- this .context = context ;
318+ this .context = Objects . requireNonNull ( context ) ;
318319 }
319320
320321 @ Override
@@ -327,6 +328,7 @@ class And implements Criterion {
327328 public final List <Criterion > criterionList ;
328329
329330 public And (List <Criterion > criterionList ) {
331+ Objects .requireNonNull (criterionList );
330332 this .criterionList = Collections .unmodifiableList (criterionList );
331333 }
332334
@@ -340,6 +342,7 @@ class Or implements Criterion {
340342 public final List <Criterion > criterionList ;
341343
342344 public Or (List <Criterion > criterionList ) {
345+ Objects .requireNonNull (criterionList );
343346 this .criterionList = Collections .unmodifiableList (criterionList );
344347 }
345348
@@ -353,6 +356,7 @@ class Not implements Criterion {
353356 public final List <Criterion > criterionList ;
354357
355358 public Not (List <Criterion > criterionList ) {
359+ Objects .requireNonNull (criterionList );
356360 this .criterionList = Collections .unmodifiableList (criterionList );
357361 }
358362
0 commit comments