@@ -26,4 +26,47 @@ static void checkArgument(boolean condition, String message, Object... args) {
2626 throw new IllegalArgumentException (String .format (message , args ));
2727 }
2828 }
29+
30+ @ FormatMethod
31+ static void checkArgument (boolean condition , String message ) {
32+ if (!condition ) {
33+ throw new IllegalArgumentException (message );
34+ }
35+ }
36+
37+ @ FormatMethod
38+ static void checkArgument (boolean condition , String message , int arg1 ) {
39+ if (!condition ) {
40+ throw new IllegalArgumentException (String .format (message , arg1 ));
41+ }
42+ }
43+
44+ @ FormatMethod
45+ static void checkArgument (boolean condition , String message , int arg1 , int arg2 ) {
46+ if (!condition ) {
47+ throw new IllegalArgumentException (String .format (message , arg1 , arg2 ));
48+ }
49+ }
50+
51+ @ FormatMethod
52+ static void checkArgument (boolean condition , String message , int arg1 , int arg2 , int arg3 ) {
53+ if (!condition ) {
54+ throw new IllegalArgumentException (String .format (message , arg1 , arg2 , arg3 ));
55+ }
56+ }
57+
58+ @ FormatMethod
59+ static void checkArgument (
60+ boolean condition , String message , int arg1 , int arg2 , int arg3 , int arg4 ) {
61+ if (!condition ) {
62+ throw new IllegalArgumentException (String .format (message , arg1 , arg2 , arg3 , arg4 ));
63+ }
64+ }
65+
66+ @ FormatMethod
67+ static void checkArgument (boolean condition , String message , long arg1 ) {
68+ if (!condition ) {
69+ throw new IllegalArgumentException (String .format (message , arg1 ));
70+ }
71+ }
2972}
0 commit comments