litesoft
Diff Revisions
803
vs
804
for /trunk/Java/core/Anywhere/src/org/litesoft/core/typeutils/Integers.java
|
@@ -1,5 +1,7 @@ |
1 |
1 |
|
package org.litesoft.core.typeutils; |
2 |
2 |
|
|
|
3 |
+ |
import org.litesoft.core.util.*; |
|
4 |
+ |
|
3 |
5 |
|
public class Integers |
4 |
6 |
|
{ |
5 |
7 |
|
public static final int[] EMPTY_ARRAY_PRIMITIVES = new int[0]; |
|
@@ -22,4 +24,22 @@ |
22 |
24 |
|
} |
23 |
25 |
|
throw new IllegalArgumentException( pWhat + " expected to be non-negative, but was: " + pInt ); |
24 |
26 |
|
} |
|
27 |
+ |
|
|
28 |
+ |
public static void assertNotEqual( String pObjectName, int pNotExpected, int pActual ) |
|
29 |
+ |
throws IllegalArgumentException |
|
30 |
+ |
{ |
|
31 |
+ |
if ( pNotExpected == pActual ) |
|
32 |
+ |
{ |
|
33 |
+ |
throw new IllegalArgumentException( pObjectName + ": '" + pNotExpected + "' Not allowed" ); |
|
34 |
+ |
} |
|
35 |
+ |
} |
|
36 |
+ |
|
|
37 |
+ |
public static void assertEqual( String pObjectName, int pExpected, int pActual ) |
|
38 |
+ |
throws IllegalArgumentException |
|
39 |
+ |
{ |
|
40 |
+ |
if ( pExpected != pActual ) |
|
41 |
+ |
{ |
|
42 |
+ |
throw new IllegalArgumentException( pObjectName + ": Expected '" + pExpected + "', but was '" + pActual + "'" ); |
|
43 |
+ |
} |
|
44 |
+ |
} |
25 |
45 |
|
} |