public final class NumberUtils
extends Object
Numbers.| Modifier and Type | Method and Description |
|---|---|
static int |
ensureNonNegative(int value,
String name)
Ensures the int is non-negative.
|
static long |
ensureNonNegative(long value,
String name)
Ensures the long is non-negative.
|
static int |
ensurePositive(int value,
String name)
Ensures the int is positive, excluding zero.
|
static long |
ensurePositive(long value,
String name)
Ensures the long is positive, excluding zero.
|
public static int ensurePositive(int value,
String name)
value - the int value to validatename - name of the variableIllegalArgumentException - if the passed int is not greater than zeropublic static long ensurePositive(long value,
String name)
value - the long value to validatename - name of the variableIllegalArgumentException - if the passed long is not greater than zeropublic static int ensureNonNegative(int value,
String name)
value - the int value to validatename - name of the variableIllegalArgumentException - if the passed int is less than zeropublic static long ensureNonNegative(long value,
String name)
value - the long value to validatename - name of the variableIllegalArgumentException - if the passed long is less than zero