@@ -45,7 +45,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template)
45
45
public static <T > T getValueOrThrow (Result <T > result , String template , Object ... args )
46
46
throws UnexpectedResultException {
47
47
if (!result .isSuccess ()) {
48
- result .getStatus ().expectSuccess (String .format (template , args ));
48
+ result .getStatus ().expectSuccess (
49
+ String .format (template , args )
50
+ );
49
51
}
50
52
return result .getValue ();
51
53
}
@@ -65,7 +67,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, Object...
65
67
public static <T > T getValueOrThrow (Result <T > result , String template , int a1 )
66
68
throws UnexpectedResultException {
67
69
if (!result .isSuccess ()) {
68
- result .getStatus ().expectSuccess (String .format (template , a1 ));
70
+ result .getStatus ().expectSuccess (
71
+ String .format (template , a1 )
72
+ );
69
73
}
70
74
return result .getValue ();
71
75
}
@@ -85,7 +89,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, int a1)
85
89
public static <T > T getValueOrThrow (Result <T > result , String template , long a1 )
86
90
throws UnexpectedResultException {
87
91
if (!result .isSuccess ()) {
88
- result .getStatus ().expectSuccess (String .format (template , a1 ));
92
+ result .getStatus ().expectSuccess (
93
+ String .format (template , a1 )
94
+ );
89
95
}
90
96
return result .getValue ();
91
97
}
@@ -105,7 +111,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, long a1)
105
111
public static <T > T getValueOrThrow (Result <T > result , String template , boolean a1 )
106
112
throws UnexpectedResultException {
107
113
if (!result .isSuccess ()) {
108
- result .getStatus ().expectSuccess (String .format (template , a1 ));
114
+ result .getStatus ().expectSuccess (
115
+ String .format (template , a1 )
116
+ );
109
117
}
110
118
return result .getValue ();
111
119
}
@@ -125,7 +133,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, boolean a
125
133
public static <T > T getValueOrThrow (Result <T > result , String template , Object a1 )
126
134
throws UnexpectedResultException {
127
135
if (!result .isSuccess ()) {
128
- result .getStatus ().expectSuccess (String .format (template , a1 ));
136
+ result .getStatus ().expectSuccess (
137
+ String .format (template , a1 )
138
+ );
129
139
}
130
140
return result .getValue ();
131
141
}
@@ -146,7 +156,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, Object a1
146
156
public static <T > T getValueOrThrow (Result <T > result , String template , int a1 , int a2 )
147
157
throws UnexpectedResultException {
148
158
if (!result .isSuccess ()) {
149
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
159
+ result .getStatus ().expectSuccess (
160
+ String .format (template , a1 , a2 )
161
+ );
150
162
}
151
163
return result .getValue ();
152
164
}
@@ -167,7 +179,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, int a1, i
167
179
public static <T > T getValueOrThrow (Result <T > result , String template , long a1 , int a2 )
168
180
throws UnexpectedResultException {
169
181
if (!result .isSuccess ()) {
170
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
182
+ result .getStatus ().expectSuccess (
183
+ String .format (template , a1 , a2 )
184
+ );
171
185
}
172
186
return result .getValue ();
173
187
}
@@ -188,7 +202,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, long a1,
188
202
public static <T > T getValueOrThrow (Result <T > result , String template , boolean a1 , int a2 )
189
203
throws UnexpectedResultException {
190
204
if (!result .isSuccess ()) {
191
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
205
+ result .getStatus ().expectSuccess (
206
+ String .format (template , a1 , a2 )
207
+ );
192
208
}
193
209
return result .getValue ();
194
210
}
@@ -209,7 +225,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, boolean a
209
225
public static <T > T getValueOrThrow (Result <T > result , String template , Object a1 , int a2 )
210
226
throws UnexpectedResultException {
211
227
if (!result .isSuccess ()) {
212
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
228
+ result .getStatus ().expectSuccess (
229
+ String .format (template , a1 , a2 )
230
+ );
213
231
}
214
232
return result .getValue ();
215
233
}
@@ -230,7 +248,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, Object a1
230
248
public static <T > T getValueOrThrow (Result <T > result , String template , int a1 , long a2 )
231
249
throws UnexpectedResultException {
232
250
if (!result .isSuccess ()) {
233
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
251
+ result .getStatus ().expectSuccess (
252
+ String .format (template , a1 , a2 )
253
+ );
234
254
}
235
255
return result .getValue ();
236
256
}
@@ -251,7 +271,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, int a1, l
251
271
public static <T > T getValueOrThrow (Result <T > result , String template , long a1 , long a2 )
252
272
throws UnexpectedResultException {
253
273
if (!result .isSuccess ()) {
254
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
274
+ result .getStatus ().expectSuccess (
275
+ String .format (template , a1 , a2 )
276
+ );
255
277
}
256
278
return result .getValue ();
257
279
}
@@ -272,7 +294,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, long a1,
272
294
public static <T > T getValueOrThrow (Result <T > result , String template , boolean a1 , long a2 )
273
295
throws UnexpectedResultException {
274
296
if (!result .isSuccess ()) {
275
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
297
+ result .getStatus ().expectSuccess (
298
+ String .format (template , a1 , a2 )
299
+ );
276
300
}
277
301
return result .getValue ();
278
302
}
@@ -293,7 +317,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, boolean a
293
317
public static <T > T getValueOrThrow (Result <T > result , String template , Object a1 , long a2 )
294
318
throws UnexpectedResultException {
295
319
if (!result .isSuccess ()) {
296
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
320
+ result .getStatus ().expectSuccess (
321
+ String .format (template , a1 , a2 )
322
+ );
297
323
}
298
324
return result .getValue ();
299
325
}
@@ -314,7 +340,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, Object a1
314
340
public static <T > T getValueOrThrow (Result <T > result , String template , int a1 , boolean a2 )
315
341
throws UnexpectedResultException {
316
342
if (!result .isSuccess ()) {
317
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
343
+ result .getStatus ().expectSuccess (
344
+ String .format (template , a1 , a2 )
345
+ );
318
346
}
319
347
return result .getValue ();
320
348
}
@@ -335,7 +363,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, int a1, b
335
363
public static <T > T getValueOrThrow (Result <T > result , String template , long a1 , boolean a2 )
336
364
throws UnexpectedResultException {
337
365
if (!result .isSuccess ()) {
338
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
366
+ result .getStatus ().expectSuccess (
367
+ String .format (template , a1 , a2 )
368
+ );
339
369
}
340
370
return result .getValue ();
341
371
}
@@ -356,7 +386,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, long a1,
356
386
public static <T > T getValueOrThrow (Result <T > result , String template , boolean a1 , boolean a2 )
357
387
throws UnexpectedResultException {
358
388
if (!result .isSuccess ()) {
359
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
389
+ result .getStatus ().expectSuccess (
390
+ String .format (template , a1 , a2 )
391
+ );
360
392
}
361
393
return result .getValue ();
362
394
}
@@ -377,7 +409,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, boolean a
377
409
public static <T > T getValueOrThrow (Result <T > result , String template , Object a1 , boolean a2 )
378
410
throws UnexpectedResultException {
379
411
if (!result .isSuccess ()) {
380
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
412
+ result .getStatus ().expectSuccess (
413
+ String .format (template , a1 , a2 )
414
+ );
381
415
}
382
416
return result .getValue ();
383
417
}
@@ -398,7 +432,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, Object a1
398
432
public static <T > T getValueOrThrow (Result <T > result , String template , int a1 , Object a2 )
399
433
throws UnexpectedResultException {
400
434
if (!result .isSuccess ()) {
401
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
435
+ result .getStatus ().expectSuccess (
436
+ String .format (template , a1 , a2 )
437
+ );
402
438
}
403
439
return result .getValue ();
404
440
}
@@ -419,7 +455,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, int a1, O
419
455
public static <T > T getValueOrThrow (Result <T > result , String template , long a1 , Object a2 )
420
456
throws UnexpectedResultException {
421
457
if (!result .isSuccess ()) {
422
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
458
+ result .getStatus ().expectSuccess (
459
+ String .format (template , a1 , a2 )
460
+ );
423
461
}
424
462
return result .getValue ();
425
463
}
@@ -440,14 +478,15 @@ public static <T> T getValueOrThrow(Result<T> result, String template, long a1,
440
478
public static <T > T getValueOrThrow (Result <T > result , String template , boolean a1 , Object a2 )
441
479
throws UnexpectedResultException {
442
480
if (!result .isSuccess ()) {
443
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
481
+ result .getStatus ().expectSuccess (
482
+ String .format (template , a1 , a2 )
483
+ );
444
484
}
445
485
return result .getValue ();
446
486
}
447
487
448
488
/**
449
489
* Extract a value of the result or throws an exception if the result is unsuccessful.
450
- *
451
490
* @param <T> type of the value
452
491
* @param result a result
453
492
* @param template a template for the exception message to use if the result is unsuccessful;
@@ -461,7 +500,9 @@ public static <T> T getValueOrThrow(Result<T> result, String template, boolean a
461
500
public static <T > T getValueOrThrow (Result <T > result , String template , Object a1 , Object a2 )
462
501
throws UnexpectedResultException {
463
502
if (!result .isSuccess ()) {
464
- result .getStatus ().expectSuccess (String .format (template , a1 , a2 ));
503
+ result .getStatus ().expectSuccess (
504
+ String .format (template , a1 , a2 )
505
+ );
465
506
}
466
507
return result .getValue ();
467
508
}
0 commit comments