• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

trydofor / professional-mirana / #102

01 Feb 2025 03:15PM UTC coverage: 87.085% (+0.3%) from 86.782%
#102

push

trydofor
📝 opt default hit message #49

192 of 193 new or added lines in 1 file covered. (99.48%)

1 existing line in 1 file now uncovered.

7053 of 8099 relevant lines covered (87.08%)

0.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

99.48
/src/main/java/pro/fessional/mirana/best/AssertCrud.java
1
package pro.fessional.mirana.best;
2

3
import org.jetbrains.annotations.Contract;
4
import pro.fessional.mirana.cond.PredictVal;
5
import pro.fessional.mirana.i18n.CodeEnum;
6
import pro.fessional.mirana.pain.CrudException;
7
import pro.fessional.mirana.text.FormatUtil;
8

9
/**
10
 * <pre>
11
 * assertXxx return void
12
 * affectXxx return para1
13
 * </pre>
14
 *
15
 * @author trydofor
16
 * @since 2019-09-18
17
 */
NEW
18
public class AssertCrud {
×
19

20
    //
21
    public static void assertEq(int a, int b, CodeEnum err) {
22
        if (PredictVal.ne(a, b)) throw new CrudException(err);
1✔
23
    }
1✔
24

25
    public static void assertEq(int a, int b, CodeEnum err, Object... args) {
26
        if (PredictVal.ne(a, b)) throw new CrudException(err, args);
1✔
27
    }
1✔
28

29
    public static void assertNe(int a, int b, CodeEnum err) {
30
        if (PredictVal.eq(a, b)) throw new CrudException(err);
1✔
31
    }
1✔
32

33
    public static void assertNe(int a, int b, CodeEnum err, Object... args) {
34
        if (PredictVal.eq(a, b)) throw new CrudException(err, args);
1✔
35
    }
1✔
36

37
    public static void assertGt(int a, int b, CodeEnum err) {
38
        if (PredictVal.le(a, b)) throw new CrudException(err);
1✔
39
    }
1✔
40

41
    public static void assertGt(int a, int b, CodeEnum err, Object... args) {
42
        if (PredictVal.le(a, b)) throw new CrudException(err, args);
1✔
43
    }
1✔
44

45
    public static void assertGe(int a, int b, CodeEnum err) {
46
        if (PredictVal.lt(a, b)) throw new CrudException(err);
1✔
47
    }
1✔
48

49
    public static void assertGe(int a, int b, CodeEnum err, Object... args) {
50
        if (PredictVal.lt(a, b)) throw new CrudException(err, args);
1✔
51
    }
1✔
52

53
    public static void assertLt(int a, int b, CodeEnum err) {
54
        if (PredictVal.ge(a, b)) throw new CrudException(err);
1✔
55
    }
1✔
56

57
    public static void assertLt(int a, int b, CodeEnum err, Object... args) {
58
        if (PredictVal.ge(a, b)) throw new CrudException(err, args);
1✔
59
    }
1✔
60

61
    public static void assertLe(int a, int b, CodeEnum err) {
62
        if (PredictVal.gt(a, b)) throw new CrudException(err);
1✔
63
    }
1✔
64

65
    public static void assertLe(int a, int b, CodeEnum err, Object... args) {
66
        if (PredictVal.gt(a, b)) throw new CrudException(err, args);
1✔
67
    }
1✔
68

69
    public static void assertEq(int[] a, int b, CodeEnum err) {
70
        if (PredictVal.ne(a, b)) throw new CrudException(err);
1✔
71
    }
1✔
72

73
    public static void assertEq(int[] a, int b, CodeEnum err, Object... args) {
74
        if (PredictVal.ne(a, b)) throw new CrudException(err, args);
1✔
75
    }
1✔
76

77
    public static void assertNe(int[] a, int b, CodeEnum err) {
78
        if (PredictVal.eq(a, b)) throw new CrudException(err);
1✔
79
    }
1✔
80

81
    public static void assertNe(int[] a, int b, CodeEnum err, Object... args) {
82
        if (PredictVal.eq(a, b)) throw new CrudException(err, args);
1✔
83
    }
1✔
84

85
    public static void assertGt(int[] a, int b, CodeEnum err) {
86
        if (PredictVal.le(a, b)) throw new CrudException(err);
1✔
87
    }
1✔
88

89
    public static void assertGt(int[] a, int b, CodeEnum err, Object... args) {
90
        if (PredictVal.le(a, b)) throw new CrudException(err, args);
1✔
91
    }
1✔
92

93
    public static void assertGe(int[] a, int b, CodeEnum err) {
94
        if (PredictVal.lt(a, b)) throw new CrudException(err);
1✔
95
    }
1✔
96

97
    public static void assertGe(int[] a, int b, CodeEnum err, Object... args) {
98
        if (PredictVal.lt(a, b)) throw new CrudException(err, args);
1✔
99
    }
1✔
100

101
    public static void assertLt(int[] a, int b, CodeEnum err) {
102
        if (PredictVal.ge(a, b)) throw new CrudException(err);
1✔
103
    }
1✔
104

105
    public static void assertLt(int[] a, int b, CodeEnum err, Object... args) {
106
        if (PredictVal.ge(a, b)) throw new CrudException(err, args);
1✔
107
    }
1✔
108

109
    public static void assertLe(int[] a, int b, CodeEnum err) {
110
        if (PredictVal.gt(a, b)) throw new CrudException(err);
1✔
111
    }
1✔
112

113
    public static void assertLe(int[] a, int b, CodeEnum err, Object... args) {
114
        if (PredictVal.gt(a, b)) throw new CrudException(err, args);
1✔
115
    }
1✔
116

117
    //
118
    @Contract("_,_,_->param1")
119
    public static int affectEq(int a, int b, CodeEnum err) {
120
        if (PredictVal.ne(a, b)) throw new CrudException(err);
1✔
121
        return a;
1✔
122
    }
123

124
    @Contract("_,_,_,_->param1")
125
    public static int affectEq(int a, int b, CodeEnum err, Object... args) {
126
        if (PredictVal.ne(a, b)) throw new CrudException(err, args);
1✔
127
        return a;
1✔
128
    }
129

130
    @Contract("_,_,_->param1")
131
    public static int affectNe(int a, int b, CodeEnum err) {
132
        if (PredictVal.eq(a, b)) throw new CrudException(err);
1✔
133
        return a;
1✔
134
    }
135

136
    @Contract("_,_,_,_->param1")
137
    public static int affectNe(int a, int b, CodeEnum err, Object... args) {
138
        if (PredictVal.eq(a, b)) throw new CrudException(err, args);
1✔
139
        return a;
1✔
140
    }
141

142
    @Contract("_,_,_->param1")
143
    public static int affectGt(int a, int b, CodeEnum err) {
144
        if (PredictVal.le(a, b)) throw new CrudException(err);
1✔
145
        return a;
1✔
146
    }
147

148
    @Contract("_,_,_,_->param1")
149
    public static int affectGt(int a, int b, CodeEnum err, Object... args) {
150
        if (PredictVal.le(a, b)) throw new CrudException(err, args);
1✔
151
        return a;
1✔
152
    }
153

154
    @Contract("_,_,_->param1")
155
    public static int affectGe(int a, int b, CodeEnum err) {
156
        if (PredictVal.lt(a, b)) throw new CrudException(err);
1✔
157
        return a;
1✔
158
    }
159

160
    @Contract("_,_,_,_->param1")
161
    public static int affectGe(int a, int b, CodeEnum err, Object... args) {
162
        if (PredictVal.lt(a, b)) throw new CrudException(err, args);
1✔
163
        return a;
1✔
164
    }
165

166
    @Contract("_,_,_->param1")
167
    public static int affectLt(int a, int b, CodeEnum err) {
168
        if (PredictVal.ge(a, b)) throw new CrudException(err);
1✔
169
        return a;
1✔
170
    }
171

172
    @Contract("_,_,_,_->param1")
173
    public static int affectLt(int a, int b, CodeEnum err, Object... args) {
174
        if (PredictVal.ge(a, b)) throw new CrudException(err, args);
1✔
175
        return a;
1✔
176
    }
177

178
    @Contract("_,_,_->param1")
179
    public static int affectLe(int a, int b, CodeEnum err) {
180
        if (PredictVal.gt(a, b)) throw new CrudException(err);
1✔
181
        return a;
1✔
182
    }
183

184
    @Contract("_,_,_,_->param1")
185
    public static int affectLe(int a, int b, CodeEnum err, Object... args) {
186
        if (PredictVal.gt(a, b)) throw new CrudException(err, args);
1✔
187
        return a;
1✔
188
    }
189

190
    @Contract("_,_,_->param1")
191
    public static int[] affectEq(int[] a, int b, CodeEnum err) {
192
        if (PredictVal.ne(a, b)) throw new CrudException(err);
1✔
193
        return a;
1✔
194
    }
195

196
    @Contract("_,_,_,_->param1")
197
    public static int[] affectEq(int[] a, int b, CodeEnum err, Object... args) {
198
        if (PredictVal.ne(a, b)) throw new CrudException(err, args);
1✔
199
        return a;
1✔
200
    }
201

202
    @Contract("_,_,_->param1")
203
    public static int[] affectNe(int[] a, int b, CodeEnum err) {
204
        if (PredictVal.eq(a, b)) throw new CrudException(err);
1✔
205
        return a;
1✔
206
    }
207

208
    @Contract("_,_,_,_->param1")
209
    public static int[] affectNe(int[] a, int b, CodeEnum err, Object... args) {
210
        if (PredictVal.eq(a, b)) throw new CrudException(err, args);
1✔
211
        return a;
1✔
212
    }
213

214
    @Contract("_,_,_->param1")
215
    public static int[] affectGt(int[] a, int b, CodeEnum err) {
216
        if (PredictVal.le(a, b)) throw new CrudException(err);
1✔
217
        return a;
1✔
218
    }
219

220
    @Contract("_,_,_,_->param1")
221
    public static int[] affectGt(int[] a, int b, CodeEnum err, Object... args) {
222
        if (PredictVal.le(a, b)) throw new CrudException(err, args);
1✔
223
        return a;
1✔
224
    }
225

226
    @Contract("_,_,_->param1")
227
    public static int[] affectGe(int[] a, int b, CodeEnum err) {
228
        if (PredictVal.lt(a, b)) throw new CrudException(err);
1✔
229
        return a;
1✔
230
    }
231

232
    @Contract("_,_,_,_->param1")
233
    public static int[] affectGe(int[] a, int b, CodeEnum err, Object... args) {
234
        if (PredictVal.lt(a, b)) throw new CrudException(err, args);
1✔
235
        return a;
1✔
236
    }
237

238
    @Contract("_,_,_->param1")
239
    public static int[] affectLt(int[] a, int b, CodeEnum err) {
240
        if (PredictVal.ge(a, b)) throw new CrudException(err);
1✔
241
        return a;
1✔
242
    }
243

244
    @Contract("_,_,_,_->param1")
245
    public static int[] affectLt(int[] a, int b, CodeEnum err, Object... args) {
246
        if (PredictVal.ge(a, b)) throw new CrudException(err, args);
1✔
247
        return a;
1✔
248
    }
249

250
    @Contract("_,_,_->param1")
251
    public static int[] affectLe(int[] a, int b, CodeEnum err) {
252
        if (PredictVal.gt(a, b)) throw new CrudException(err);
1✔
253
        return a;
1✔
254
    }
255

256
    @Contract("_,_,_,_->param1")
257
    public static int[] affectLe(int[] a, int b, CodeEnum err, Object... args) {
258
        if (PredictVal.gt(a, b)) throw new CrudException(err, args);
1✔
259
        return a;
1✔
260
    }
261

262
    //
263
    public static void assertEq(int a, int b, String err) {
264
        if (PredictVal.ne(a, b)) throw new IllegalStateException(err);
1✔
265
    }
1✔
266

267
    public static void assertNe(int a, int b, String err) {
268
        if (PredictVal.eq(a, b)) throw new IllegalStateException(err);
1✔
269
    }
1✔
270

271
    public static void assertGt(int a, int b, String err) {
272
        if (PredictVal.le(a, b)) throw new IllegalStateException(err);
1✔
273
    }
1✔
274

275
    public static void assertGe(int a, int b, String err) {
276
        if (PredictVal.lt(a, b)) throw new IllegalStateException(err);
1✔
277
    }
1✔
278

279
    public static void assertLt(int a, int b, String err) {
280
        if (PredictVal.ge(a, b)) throw new IllegalStateException(err);
1✔
281
    }
1✔
282

283
    public static void assertLe(int a, int b, String err) {
284
        if (PredictVal.gt(a, b)) throw new IllegalStateException(err);
1✔
285
    }
1✔
286

287
    public static void assertEq(int[] a, int b, String err) {
288
        if (PredictVal.ne(a, b)) throw new IllegalStateException(err);
1✔
289
    }
1✔
290

291
    public static void assertNe(int[] a, int b, String err) {
292
        if (PredictVal.eq(a, b)) throw new IllegalStateException(err);
1✔
293
    }
1✔
294

295
    public static void assertGt(int[] a, int b, String err) {
296
        if (PredictVal.le(a, b)) throw new IllegalStateException(err);
1✔
297
    }
1✔
298

299
    public static void assertGe(int[] a, int b, String err) {
300
        if (PredictVal.lt(a, b)) throw new IllegalStateException(err);
1✔
301
    }
1✔
302

303
    public static void assertLt(int[] a, int b, String err) {
304
        if (PredictVal.ge(a, b)) throw new IllegalStateException(err);
1✔
305
    }
1✔
306

307
    public static void assertLe(int[] a, int b, String err) {
308
        if (PredictVal.gt(a, b)) throw new IllegalStateException(err);
1✔
309
    }
1✔
310

311
    //
312
    @Contract("_,_,_->param1")
313
    public static int affectEq(int a, int b, String err) {
314
        if (PredictVal.ne(a, b)) throw new IllegalStateException(err);
1✔
315
        return a;
1✔
316
    }
317

318
    @Contract("_,_,_->param1")
319
    public static int affectNe(int a, int b, String err) {
320
        if (PredictVal.eq(a, b)) throw new IllegalStateException(err);
1✔
321
        return a;
1✔
322
    }
323

324
    @Contract("_,_,_->param1")
325
    public static int affectGt(int a, int b, String err) {
326
        if (PredictVal.le(a, b)) throw new IllegalStateException(err);
1✔
327
        return a;
1✔
328
    }
329

330
    @Contract("_,_,_->param1")
331
    public static int affectGe(int a, int b, String err) {
332
        if (PredictVal.lt(a, b)) throw new IllegalStateException(err);
1✔
333
        return a;
1✔
334
    }
335

336
    @Contract("_,_,_->param1")
337
    public static int affectLt(int a, int b, String err) {
338
        if (PredictVal.ge(a, b)) throw new IllegalStateException(err);
1✔
339
        return a;
1✔
340
    }
341

342
    @Contract("_,_,_->param1")
343
    public static int affectLe(int a, int b, String err) {
344
        if (PredictVal.gt(a, b)) throw new IllegalStateException(err);
1✔
345
        return a;
1✔
346
    }
347

348
    @Contract("_,_,_->param1")
349
    public static int[] affectEq(int[] a, int b, String err) {
350
        if (PredictVal.ne(a, b)) throw new IllegalStateException(err);
1✔
351
        return a;
1✔
352
    }
353

354
    @Contract("_,_,_->param1")
355
    public static int[] affectNe(int[] a, int b, String err) {
356
        if (PredictVal.eq(a, b)) throw new IllegalStateException(err);
1✔
357
        return a;
1✔
358
    }
359

360
    @Contract("_,_,_->param1")
361
    public static int[] affectGt(int[] a, int b, String err) {
362
        if (PredictVal.le(a, b)) throw new IllegalStateException(err);
1✔
363
        return a;
1✔
364
    }
365

366
    @Contract("_,_,_->param1")
367
    public static int[] affectGe(int[] a, int b, String err) {
368
        if (PredictVal.lt(a, b)) throw new IllegalStateException(err);
1✔
369
        return a;
1✔
370
    }
371

372
    @Contract("_,_,_->param1")
373
    public static int[] affectLt(int[] a, int b, String err) {
374
        if (PredictVal.ge(a, b)) throw new IllegalStateException(err);
1✔
375
        return a;
1✔
376
    }
377

378
    @Contract("_,_,_->param1")
379
    public static int[] affectLe(int[] a, int b, String err) {
380
        if (PredictVal.gt(a, b)) throw new IllegalStateException(err);
1✔
381
        return a;
1✔
382
    }
383

384
    //
385
    public static void assertEq(int a, int b, String err, Object... arg) {
386
        if (PredictVal.ne(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
387
    }
1✔
388

389
    public static void assertNe(int a, int b, String err, Object... arg) {
390
        if (PredictVal.eq(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
391
    }
1✔
392

393
    public static void assertGt(int a, int b, String err, Object... arg) {
394
        if (PredictVal.le(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
395
    }
1✔
396

397
    public static void assertGe(int a, int b, String err, Object... arg) {
398
        if (PredictVal.lt(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
399
    }
1✔
400

401
    public static void assertLt(int a, int b, String err, Object... arg) {
402
        if (PredictVal.ge(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
403
    }
1✔
404

405
    public static void assertLe(int a, int b, String err, Object... arg) {
406
        if (PredictVal.gt(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
407
    }
1✔
408

409
    public static void assertEq(int[] a, int b, String err, Object... arg) {
410
        if (PredictVal.ne(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
411
    }
1✔
412

413
    public static void assertNe(int[] a, int b, String err, Object... arg) {
414
        if (PredictVal.eq(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
415
    }
1✔
416

417
    public static void assertGt(int[] a, int b, String err, Object... arg) {
418
        if (PredictVal.le(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
419
    }
1✔
420

421
    public static void assertGe(int[] a, int b, String err, Object... arg) {
422
        if (PredictVal.lt(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
423
    }
1✔
424

425
    public static void assertLt(int[] a, int b, String err, Object... arg) {
426
        if (PredictVal.ge(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
427
    }
1✔
428

429
    public static void assertLe(int[] a, int b, String err, Object... arg) {
430
        if (PredictVal.gt(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
431
    }
1✔
432

433
    //
434
    @Contract("_,_,_,_->param1")
435
    public static int affectEq(int a, int b, String err, Object... arg) {
436
        if (PredictVal.ne(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
437
        return a;
1✔
438
    }
439

440
    @Contract("_,_,_,_->param1")
441
    public static int affectNe(int a, int b, String err, Object... arg) {
442
        if (PredictVal.eq(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
443
        return a;
1✔
444
    }
445

446
    @Contract("_,_,_,_->param1")
447
    public static int affectGt(int a, int b, String err, Object... arg) {
448
        if (PredictVal.le(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
449
        return a;
1✔
450
    }
451

452
    @Contract("_,_,_,_->param1")
453
    public static int affectGe(int a, int b, String err, Object... arg) {
454
        if (PredictVal.lt(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
455
        return a;
1✔
456
    }
457

458
    @Contract("_,_,_,_->param1")
459
    public static int affectLt(int a, int b, String err, Object... arg) {
460
        if (PredictVal.ge(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
461
        return a;
1✔
462
    }
463

464
    @Contract("_,_,_,_->param1")
465
    public static int affectLe(int a, int b, String err, Object... arg) {
466
        if (PredictVal.gt(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
467
        return a;
1✔
468
    }
469

470
    @Contract("_,_,_,_->param1")
471
    public static int[] affectEq(int[] a, int b, String err, Object... arg) {
472
        if (PredictVal.ne(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
473
        return a;
1✔
474
    }
475

476
    @Contract("_,_,_,_->param1")
477
    public static int[] affectNe(int[] a, int b, String err, Object... arg) {
478
        if (PredictVal.eq(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
479
        return a;
1✔
480
    }
481

482
    @Contract("_,_,_,_->param1")
483
    public static int[] affectGt(int[] a, int b, String err, Object... arg) {
484
        if (PredictVal.le(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
485
        return a;
1✔
486
    }
487

488
    @Contract("_,_,_,_->param1")
489
    public static int[] affectGe(int[] a, int b, String err, Object... arg) {
490
        if (PredictVal.lt(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
491
        return a;
1✔
492
    }
493

494
    @Contract("_,_,_,_->param1")
495
    public static int[] affectLt(int[] a, int b, String err, Object... arg) {
496
        if (PredictVal.ge(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
497
        return a;
1✔
498
    }
499

500
    @Contract("_,_,_,_->param1")
501
    public static int[] affectLe(int[] a, int b, String err, Object... arg) {
502
        if (PredictVal.gt(a, b)) throw new IllegalStateException(FormatUtil.logback(err, arg));
1✔
503
        return a;
1✔
504
    }
505
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc