litesoft
@ 943
litesoft / trunk / DeviceDesktopTest / src / org / litesoft / commonfoundation / typeutils / Longs.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
package org.litesoft.commonfoundation.typeutils; public class Longs extends Numerics { public static Long assertNonNegative( String pName, Long pValue ) throws IllegalArgumentException { if ( pValue != null ) { assertNonNegative( pName, pValue.longValue() ); } return pValue; } public static long assertNonNegative( String pName, long pValue ) throws IllegalArgumentException { if ( pValue < 0 ) { throw new IllegalArgumentException( pName + CANNOT_BE_NEGATIVE + ", but was: " + pValue ); } return pValue; } public static void assertNotEqual( String pObjectName, long pNotExpected, long pActual ) throws IllegalArgumentException { if ( pNotExpected == pActual ) { throw new IllegalArgumentException( pObjectName + ": '" + pNotExpected + "' Not allowed" ); } } } |