public final class Argument extends Object
Modifier and Type | Method and Description |
---|---|
static byte |
checkGreaterThan(byte value,
byte number)
|
static byte |
checkGreaterThan(byte value,
byte number,
String name)
|
static char |
checkGreaterThan(char value,
char number)
|
static char |
checkGreaterThan(char value,
char number,
String name)
|
static double |
checkGreaterThan(double value,
double number)
|
static double |
checkGreaterThan(double value,
double number,
double epsilon)
|
static double |
checkGreaterThan(double value,
double number,
double epsilon,
String name)
|
static double |
checkGreaterThan(double value,
double number,
String name)
|
static float |
checkGreaterThan(float value,
float number)
|
static float |
checkGreaterThan(float value,
float number,
float epsilon)
|
static float |
checkGreaterThan(float value,
float number,
float epsilon,
String name)
|
static float |
checkGreaterThan(float value,
float number,
String name)
|
static int |
checkGreaterThan(int value,
int number)
|
static int |
checkGreaterThan(int value,
int number,
String name)
|
static long |
checkGreaterThan(long value,
long number)
|
static long |
checkGreaterThan(long value,
long number,
String name)
|
static short |
checkGreaterThan(short value,
short number)
|
static short |
checkGreaterThan(short value,
short number,
String name)
|
static byte |
checkGreaterThanOrEqual(byte value,
byte number)
|
static byte |
checkGreaterThanOrEqual(byte value,
byte number,
String name)
|
static char |
checkGreaterThanOrEqual(char value,
char number)
|
static char |
checkGreaterThanOrEqual(char value,
char number,
String name)
|
static double |
checkGreaterThanOrEqual(double value,
double number)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static double |
checkGreaterThanOrEqual(double value,
double number,
double epsilon)
|
static double |
checkGreaterThanOrEqual(double value,
double number,
double epsilon,
String name)
|
static double |
checkGreaterThanOrEqual(double value,
double number,
String name)
|
static float |
checkGreaterThanOrEqual(float value,
float number)
|
static float |
checkGreaterThanOrEqual(float value,
float number,
float epsilon)
|
static float |
checkGreaterThanOrEqual(float value,
float number,
float epsilon,
String name)
|
static float |
checkGreaterThanOrEqual(float value,
float number,
String name)
|
static int |
checkGreaterThanOrEqual(int value,
int number)
|
static int |
checkGreaterThanOrEqual(int value,
int number,
String name)
|
static long |
checkGreaterThanOrEqual(long value,
long number)
|
static long |
checkGreaterThanOrEqual(long value,
long number,
String name)
|
static short |
checkGreaterThanOrEqual(short value,
short number)
|
static short |
checkGreaterThanOrEqual(short value,
short number,
String name)
|
static byte |
checkInsideRange(byte value,
byte min,
byte max)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static byte |
checkInsideRange(byte value,
byte min,
byte max,
String name)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static char |
checkInsideRange(char value,
char min,
char max)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static char |
checkInsideRange(char value,
char min,
char max,
String name)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static double |
checkInsideRange(double value,
double min,
double max)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static double |
checkInsideRange(double value,
double min,
double max,
double epsilon)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static double |
checkInsideRange(double value,
double min,
double max,
double epsilon,
String name)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static double |
checkInsideRange(double value,
double min,
double max,
String name)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static float |
checkInsideRange(float value,
float min,
float max)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static float |
checkInsideRange(float value,
float min,
float max,
float epsilon)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static float |
checkInsideRange(float value,
float min,
float max,
float epsilon,
String name)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static float |
checkInsideRange(float value,
float min,
float max,
String name)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static int |
checkInsideRange(int value,
int min,
int max)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static int |
checkInsideRange(int value,
int min,
int max,
String name)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static long |
checkInsideRange(long value,
long min,
long max)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static long |
checkInsideRange(long value,
long min,
long max,
String name)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static short |
checkInsideRange(short value,
short min,
short max)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static short |
checkInsideRange(short value,
short min,
short max,
String name)
Returns
value if it is inside the specified range, which means
greater than or equal to min and less than or equal to
max . |
static boolean[] |
checkLength(boolean[] array,
int length)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static boolean[] |
checkLength(boolean[] array,
int length,
String name)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static byte[] |
checkLength(byte[] array,
int length)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static byte[] |
checkLength(byte[] array,
int length,
String name)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static char[] |
checkLength(char[] array,
int length)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static char[] |
checkLength(char[] array,
int length,
String name)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static double[] |
checkLength(double[] array,
int length)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static double[] |
checkLength(double[] array,
int length,
String name)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static float[] |
checkLength(float[] array,
int length)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static float[] |
checkLength(float[] array,
int length,
String name)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static int[] |
checkLength(int[] array,
int length)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static int[] |
checkLength(int[] array,
int length,
String name)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static long[] |
checkLength(long[] array,
int length)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static long[] |
checkLength(long[] array,
int length,
String name)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static short[] |
checkLength(short[] array,
int length)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static short[] |
checkLength(short[] array,
int length,
String name)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static <T> T[] |
checkLength(T[] array,
int length)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static <T> T[] |
checkLength(T[] array,
int length,
String name)
Returns
array if it's not null and its length equals
length , otherwise throws IllegalArgumentException . |
static byte |
checkLessThan(byte value,
byte number)
|
static byte |
checkLessThan(byte value,
byte number,
String name)
|
static char |
checkLessThan(char value,
char number)
|
static char |
checkLessThan(char value,
char number,
String name)
|
static double |
checkLessThan(double value,
double number)
|
static double |
checkLessThan(double value,
double number,
double epsilon)
|
static double |
checkLessThan(double value,
double number,
double epsilon,
String name)
|
static double |
checkLessThan(double value,
double number,
String name)
|
static float |
checkLessThan(float value,
float number)
|
static float |
checkLessThan(float value,
float number,
float epsilon)
|
static float |
checkLessThan(float value,
float number,
float epsilon,
String name)
|
static float |
checkLessThan(float value,
float number,
String name)
|
static int |
checkLessThan(int value,
int number)
|
static int |
checkLessThan(int value,
int number,
String name)
|
static long |
checkLessThan(long value,
long number)
|
static long |
checkLessThan(long value,
long number,
String name)
|
static short |
checkLessThan(short value,
short number)
|
static short |
checkLessThan(short value,
short number,
String name)
|
static byte |
checkLessThanOrEqual(byte value,
byte number)
|
static byte |
checkLessThanOrEqual(byte value,
byte number,
String name)
|
static char |
checkLessThanOrEqual(char value,
char number)
|
static char |
checkLessThanOrEqual(char value,
char number,
String name)
|
static double |
checkLessThanOrEqual(double value,
double number)
|
static double |
checkLessThanOrEqual(double value,
double number,
double epsilon)
|
static double |
checkLessThanOrEqual(double value,
double number,
double epsilon,
String name)
|
static double |
checkLessThanOrEqual(double value,
double number,
String name)
|
static float |
checkLessThanOrEqual(float value,
float number)
|
static float |
checkLessThanOrEqual(float value,
float number,
float epsilon)
|
static float |
checkLessThanOrEqual(float value,
float number,
float epsilon,
String name)
|
static float |
checkLessThanOrEqual(float value,
float number,
String name)
|
static int |
checkLessThanOrEqual(int value,
int number)
|
static int |
checkLessThanOrEqual(int value,
int number,
String name)
|
static long |
checkLessThanOrEqual(long value,
long number)
|
static long |
checkLessThanOrEqual(long value,
long number,
String name)
|
static short |
checkLessThanOrEqual(short value,
short number)
|
static short |
checkLessThanOrEqual(short value,
short number,
String name)
|
static byte |
checkNegative(byte value)
Returns
value if it is negative, which means less than 0. |
static byte |
checkNegative(byte value,
String name)
Returns
value if it is negative, which means less than 0. |
static double |
checkNegative(double value)
Returns
value if it is negative, which means less than 0. |
static double |
checkNegative(double value,
double epsilon)
Returns
value if it is negative, which means less than 0. |
static double |
checkNegative(double value,
double epsilon,
String name)
Returns
value if it is negative, which means less than 0. |
static double |
checkNegative(double value,
String name)
Returns
value if it is negative, which means less than 0. |
static float |
checkNegative(float value)
Returns
value if it is negative, which means less than 0. |
static float |
checkNegative(float value,
float epsilon)
Returns
value if it is negative, which means less than 0. |
static float |
checkNegative(float value,
float epsilon,
String name)
Returns
value if it is negative, which means less than 0. |
static float |
checkNegative(float value,
String name)
Returns
value if it is negative, which means less than 0. |
static int |
checkNegative(int value)
Returns
value if it is negative, which means less than 0. |
static int |
checkNegative(int value,
String name)
Returns
value if it is negative, which means less than 0. |
static long |
checkNegative(long value)
Returns
value if it is negative, which means less than 0. |
static long |
checkNegative(long value,
String name)
Returns
value if it is negative, which means less than 0. |
static short |
checkNegative(short value)
Returns
value if it is negative, which means less than 0. |
static short |
checkNegative(short value,
String name)
Returns
value if it is negative, which means less than 0. |
static <T> T |
checkNotNull(T value)
|
static <T> T |
checkNotNull(T value,
String name)
|
static byte |
checkPercent(byte value)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static byte |
checkPercent(byte value,
String name)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static double |
checkPercent(double value)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static double |
checkPercent(double value,
double epsilon)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static double |
checkPercent(double value,
double epsilon,
String name)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static double |
checkPercent(double value,
String name)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static float |
checkPercent(float value)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static float |
checkPercent(float value,
float epsilon)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static float |
checkPercent(float value,
float epsilon,
String name)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static float |
checkPercent(float value,
String name)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static int |
checkPercent(int value)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static int |
checkPercent(int value,
String name)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static long |
checkPercent(long value)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static long |
checkPercent(long value,
String name)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static short |
checkPercent(short value)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static short |
checkPercent(short value,
String name)
Returns
value if it is a valid percent, which means between 0
and 100 (inclusive). |
static byte |
checkPositive(byte value)
Returns
value if it is positive, which means greater than or
equal to 0. |
static byte |
checkPositive(byte value,
String name)
Returns
value if it is positive, which means greater than or
equal to 0. |
static double |
checkPositive(double value)
Returns
value if it is positive, which means greater than or
equal to 0. |
static double |
checkPositive(double value,
double epsilon)
Returns
value if it is positive, which means greater than or
equal to 0. |
static double |
checkPositive(double value,
double epsilon,
String name)
Returns
value if it is positive, which means greater than or
equal to 0. |
static double |
checkPositive(double value,
String name)
Returns
value if it is positive, which means greater than or
equal to 0. |
static float |
checkPositive(float value)
Returns
value if it is positive, which means greater than or
equal to 0. |
static float |
checkPositive(float value,
float epsilon)
Returns
value if it is positive, which means greater than or
equal to 0. |
static float |
checkPositive(float value,
float epsilon,
String name)
Returns
value if it is positive, which means greater than or
equal to 0. |
static float |
checkPositive(float value,
String name)
Returns
value if it is positive, which means greater than or
equal to 0. |
static int |
checkPositive(int value)
Returns
value if it is positive, which means greater than or
equal to 0. |
static int |
checkPositive(int value,
String name)
Returns
value if it is positive, which means greater than or
equal to 0. |
static long |
checkPositive(long value)
Returns
value if it is positive, which means greater than or
equal to 0. |
static long |
checkPositive(long value,
String name)
Returns
value if it is positive, which means greater than or
equal to 0. |
static short |
checkPositive(short value)
Returns
value if it is positive, which means greater than or
equal to 0. |
static short |
checkPositive(short value,
String name)
Returns
value if it is positive, which means greater than or
equal to 0. |
public static <T> T checkNotNull(T value, String name)
T
- the type of the valuevalue
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static <T> T checkNotNull(T value)
T
- the type of the valuevalue
- the value to checkvalue
public static byte checkGreaterThan(byte value, byte number, String name)
value
- the value to checknumber
- the number that value
must be greater thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static byte checkGreaterThan(byte value, byte number)
value
- the value to checknumber
- the number that value
must be greater thanvalue
public static short checkGreaterThan(short value, short number, String name)
value
- the value to checknumber
- the number that value
must be greater thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static short checkGreaterThan(short value, short number)
value
- the value to checknumber
- the number that value
must be greater thanvalue
public static int checkGreaterThan(int value, int number, String name)
value
- the value to checknumber
- the number that value
must be greater thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static int checkGreaterThan(int value, int number)
value
- the value to checknumber
- the number that value
must be greater thanvalue
public static long checkGreaterThan(long value, long number, String name)
value
- the value to checknumber
- the number that value
must be greater thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static long checkGreaterThan(long value, long number)
value
- the value to checknumber
- the number that value
must be greater thanvalue
public static float checkGreaterThan(float value, float number, float epsilon, String name)
value
if it is greater than number
, otherwise
throws IllegalArgumentException
. The epsilon
is used to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater thanepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThan(float, float, float)
public static float checkGreaterThan(float value, float number, float epsilon)
value
if it is greater than number
, otherwise
throws IllegalArgumentException
. The epsilon
is used to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater thanepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalvalue
FloatingPoint.greaterThan(float, float, float)
public static float checkGreaterThan(float value, float number, String name)
value
if it is greater than number
, otherwise
throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to determine
if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThan(float, float)
public static float checkGreaterThan(float value, float number)
value
if it is greater than number
, otherwise
throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to determine
if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater thanvalue
FloatingPoint.greaterThan(float, float)
public static double checkGreaterThan(double value, double number, double epsilon, String name)
value
if it is greater than number
, otherwise
throws IllegalArgumentException
. The epsilon
is used to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater thanepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThan(double, double, double)
public static double checkGreaterThan(double value, double number, double epsilon)
value
if it is greater than number
, otherwise
throws IllegalArgumentException
. The epsilon
is used to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater thanepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalvalue
FloatingPoint.greaterThan(double, double, double)
public static double checkGreaterThan(double value, double number, String name)
value
if it is greater than number
, otherwise
throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThan(double, double)
public static double checkGreaterThan(double value, double number)
value
if it is greater than number
, otherwise
throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater thanvalue
FloatingPoint.greaterThan(double, double)
public static char checkGreaterThan(char value, char number, String name)
value
- the value to checknumber
- the number that value
must be greater thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static char checkGreaterThan(char value, char number)
value
- the value to checknumber
- the number that value
must be greater thanvalue
public static byte checkGreaterThanOrEqual(byte value, byte number, String name)
value
- the value to checknumber
- the number that value
must be greater than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static byte checkGreaterThanOrEqual(byte value, byte number)
value
- the value to checknumber
- the number that value
must be greater than or
equal tovalue
public static short checkGreaterThanOrEqual(short value, short number, String name)
value
- the value to checknumber
- the number that value
must be greater than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static short checkGreaterThanOrEqual(short value, short number)
value
- the value to checknumber
- the number that value
must be greater than or
equal tovalue
public static int checkGreaterThanOrEqual(int value, int number, String name)
value
- the value to checknumber
- the number that value
must be greater than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static int checkGreaterThanOrEqual(int value, int number)
value
- the value to checknumber
- the number that value
must be greater than or
equal tovalue
public static long checkGreaterThanOrEqual(long value, long number, String name)
value
- the value to checknumber
- the number that value
must be greater than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static long checkGreaterThanOrEqual(long value, long number)
value
- the value to checknumber
- the number that value
must be greater than or
equal tovalue
public static float checkGreaterThanOrEqual(float value, float number, float epsilon, String name)
value
if it is greater than or equal to number
,
otherwise throws IllegalArgumentException
. The epsilon
is used to determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater than or
equal toepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(float, float, float)
public static float checkGreaterThanOrEqual(float value, float number, float epsilon)
value
if it is greater than or equal to number
,
otherwise throws IllegalArgumentException
. The epsilon
is used to determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater than or
equal toepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalvalue
FloatingPoint.greaterThanOrEqual(float, float, float)
public static float checkGreaterThanOrEqual(float value, float number, String name)
value
if it is greater than or equal to number
,
otherwise throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to determine
if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(float, float)
public static float checkGreaterThanOrEqual(float value, float number)
value
if it is greater than or equal to number
,
otherwise throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to determine
if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater than or
equal tovalue
FloatingPoint.greaterThanOrEqual(float, float)
public static double checkGreaterThanOrEqual(double value, double number, double epsilon, String name)
value
if it is greater than or equal to number
,
otherwise throws IllegalArgumentException
. The epsilon
is used to determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater than or
equal toepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(double, double, double)
public static double checkGreaterThanOrEqual(double value, double number, double epsilon)
value
if it is greater than or equal to number
,
otherwise throws IllegalArgumentException
. The epsilon
is used to determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater than or
equal toepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalvalue
FloatingPoint.greaterThanOrEqual(double, double, double)
public static double checkGreaterThanOrEqual(double value, double number, String name)
value
if it is greater than or equal to number
,
otherwise throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(double, double)
public static double checkGreaterThanOrEqual(double value, double number)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be greater than or
equal tovalue
FloatingPoint.greaterThanOrEqual(double, double)
public static char checkGreaterThanOrEqual(char value, char number, String name)
value
- the value to checknumber
- the number that value
must be greater than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static char checkGreaterThanOrEqual(char value, char number)
value
- the value to checknumber
- the number that value
must be greater than or
equal tovalue
public static byte checkLessThan(byte value, byte number, String name)
value
- the value to checknumber
- the number that value
must be less thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static byte checkLessThan(byte value, byte number)
value
- the value to checknumber
- the number that value
must be less thanvalue
public static short checkLessThan(short value, short number, String name)
value
- the value to checknumber
- the number that value
must be less thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static short checkLessThan(short value, short number)
value
- the value to checknumber
- the number that value
must be less thanvalue
public static int checkLessThan(int value, int number, String name)
value
- the value to checknumber
- the number that value
must be less thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static int checkLessThan(int value, int number)
value
- the value to checknumber
- the number that value
must be less thanvalue
public static long checkLessThan(long value, long number, String name)
value
- the value to checknumber
- the number that value
must be less thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static long checkLessThan(long value, long number)
value
- the value to checknumber
- the number that value
must be less thanvalue
public static float checkLessThan(float value, float number, float epsilon, String name)
value
if it is less than number
, otherwise
throws IllegalArgumentException
. The epsilon
is used to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less thanepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThan(float, float, float)
public static float checkLessThan(float value, float number, float epsilon)
value
if it is less than number
, otherwise
throws IllegalArgumentException
. The epsilon
is used to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less thanepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalvalue
FloatingPoint.lessThan(float, float, float)
public static float checkLessThan(float value, float number, String name)
value
if it is less than number
, otherwise
throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to determine
if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThan(float, float)
public static float checkLessThan(float value, float number)
value
if it is less than number
, otherwise
throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to determine
if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less thanvalue
FloatingPoint.lessThan(float, float)
public static double checkLessThan(double value, double number, double epsilon, String name)
value
if it is less than number
, otherwise
throws IllegalArgumentException
. The epsilon
is used to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less thanepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThan(double, double, double)
public static double checkLessThan(double value, double number, double epsilon)
value
if it is less than number
, otherwise
throws IllegalArgumentException
. The epsilon
is used to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less thanepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalvalue
FloatingPoint.lessThan(double, double, double)
public static double checkLessThan(double value, double number, String name)
value
if it is less than number
, otherwise
throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThan(double, double)
public static double checkLessThan(double value, double number)
value
if it is less than number
, otherwise
throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less thanvalue
FloatingPoint.lessThan(double, double)
public static char checkLessThan(char value, char number, String name)
value
- the value to checknumber
- the number that value
must be less thanname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static char checkLessThan(char value, char number)
value
- the value to checknumber
- the number that value
must be less thanvalue
public static byte checkLessThanOrEqual(byte value, byte number, String name)
value
- the value to checknumber
- the number that value
must be less than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static byte checkLessThanOrEqual(byte value, byte number)
value
- the value to checknumber
- the number that value
must be less than or
equal tovalue
public static short checkLessThanOrEqual(short value, short number, String name)
value
- the value to checknumber
- the number that value
must be less than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static short checkLessThanOrEqual(short value, short number)
value
- the value to checknumber
- the number that value
must be less than or
equal tovalue
public static int checkLessThanOrEqual(int value, int number, String name)
value
- the value to checknumber
- the number that value
must be less than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static int checkLessThanOrEqual(int value, int number)
value
- the value to checknumber
- the number that value
must be less than or
equal tovalue
public static long checkLessThanOrEqual(long value, long number, String name)
value
- the value to checknumber
- the number that value
must be less than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static long checkLessThanOrEqual(long value, long number)
value
- the value to checknumber
- the number that value
must be less than or
equal tovalue
public static float checkLessThanOrEqual(float value, float number, float epsilon, String name)
value
if it is less than or equal to number
,
otherwise throws IllegalArgumentException
. The epsilon
is used to determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less than or
equal toepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThanOrEqual(float, float, float)
public static float checkLessThanOrEqual(float value, float number, float epsilon)
value
if it is less than or equal to number
,
otherwise throws IllegalArgumentException
. The epsilon
is used to determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less than or
equal toepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalvalue
FloatingPoint.lessThanOrEqual(float, float, float)
public static float checkLessThanOrEqual(float value, float number, String name)
value
if it is less than or equal to number
,
otherwise throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to determine
if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThanOrEqual(float, float)
public static float checkLessThanOrEqual(float value, float number)
value
if it is less than or equal to number
,
otherwise throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to determine
if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less than or
equal tovalue
FloatingPoint.lessThanOrEqual(float, float)
public static double checkLessThanOrEqual(double value, double number, double epsilon, String name)
value
if it is less than or equal to number
,
otherwise throws IllegalArgumentException
. The epsilon
is used to determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less than or
equal toepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThanOrEqual(double, double, double)
public static double checkLessThanOrEqual(double value, double number, double epsilon)
value
if it is less than or equal to number
,
otherwise throws IllegalArgumentException
. The epsilon
is used to determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less than or
equal toepsilon
- the acceptable margin of error between value
and
number
where they will be considered equalvalue
FloatingPoint.lessThanOrEqual(double, double, double)
public static double checkLessThanOrEqual(double value, double number, String name)
value
if it is less than or equal to number
,
otherwise throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThanOrEqual(double, double)
public static double checkLessThanOrEqual(double value, double number)
value
if it is less than or equal to number
,
otherwise throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
and number
are equal.value
- the value to checknumber
- the number that value
must be less than or
equal tovalue
FloatingPoint.lessThanOrEqual(double, double)
public static char checkLessThanOrEqual(char value, char number, String name)
value
- the value to checknumber
- the number that value
must be less than or
equal toname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static char checkLessThanOrEqual(char value, char number)
value
- the value to checknumber
- the number that value
must be less than or
equal tovalue
public static byte checkPositive(byte value, String name)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static byte checkPositive(byte value)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
.value
- the value to checkvalue
public static short checkPositive(short value, String name)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static short checkPositive(short value)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
.value
- the value to checkvalue
public static int checkPositive(int value, String name)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static int checkPositive(int value)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
.value
- the value to checkvalue
public static long checkPositive(long value, String name)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static long checkPositive(long value)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
.value
- the value to checkvalue
public static float checkPositive(float value, float epsilon, String name)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
. The
epsilon
is used to determine if value
is equal to 0.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0name
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(float, float, float)
public static float checkPositive(float value, float epsilon)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
. The
epsilon
is used to determine if value
is equal to 0.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0value
FloatingPoint.greaterThanOrEqual(float, float, float)
public static float checkPositive(float value, String name)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
. This will
use FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to
determine if value
is equal to 0.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(float, float)
public static float checkPositive(float value)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
. This will
use FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to
determine if value
is equal to 0.value
- the value to checkvalue
FloatingPoint.greaterThanOrEqual(float, float)
public static double checkPositive(double value, double epsilon, String name)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
. The
epsilon
is used to determine if value
is equal to 0.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0name
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(double, double, double)
public static double checkPositive(double value, double epsilon)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
. The
epsilon
is used to determine if value
is equal to 0.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0value
FloatingPoint.greaterThanOrEqual(double, double, double)
public static double checkPositive(double value, String name)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
. This will
use FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
is equal to 0.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(double, double)
public static double checkPositive(double value)
value
if it is positive, which means greater than or
equal to 0. If not, throws IllegalArgumentException
. This will
use FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
is equal to 0.value
- the value to checkvalue
FloatingPoint.greaterThanOrEqual(double, double)
public static byte checkNegative(byte value, String name)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static byte checkNegative(byte value)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
.value
- the value to checkvalue
public static short checkNegative(short value, String name)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static short checkNegative(short value)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
.value
- the value to checkvalue
public static int checkNegative(int value, String name)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static int checkNegative(int value)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
.value
- the value to checkvalue
public static long checkNegative(long value, String name)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static long checkNegative(long value)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
.value
- the value to checkvalue
public static float checkNegative(float value, float epsilon, String name)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
. The epsilon
is
used to determine if value
is equal to 0.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0name
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThan(float, float, float)
public static float checkNegative(float value, float epsilon)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
. The epsilon
is
used to determine if value
is equal to 0.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0value
FloatingPoint.lessThan(float, float, float)
public static float checkNegative(float value, String name)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to determine
if value
is equal to 0.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThan(float, float)
public static float checkNegative(float value)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to determine
if value
is equal to 0.value
- the value to checkvalue
FloatingPoint.lessThan(float, float)
public static double checkNegative(double value, double epsilon, String name)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
. The epsilon
is
used to determine if value
is equal to 0.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0name
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThan(double, double, double)
public static double checkNegative(double value, double epsilon)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
. The epsilon
is
used to determine if value
is equal to 0.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0value
FloatingPoint.lessThan(double, double, double)
public static double checkNegative(double value, String name)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
is equal to 0.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.lessThan(double, double)
public static double checkNegative(double value)
value
if it is negative, which means less than 0. If
not, throws IllegalArgumentException
. This will use
FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
is equal to 0.value
- the value to checkvalue
FloatingPoint.lessThan(double, double)
public static byte checkInsideRange(byte value, byte min, byte max, String name)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bename
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static byte checkInsideRange(byte value, byte min, byte max)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bevalue
public static short checkInsideRange(short value, short min, short max, String name)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bename
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static short checkInsideRange(short value, short min, short max)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bevalue
public static int checkInsideRange(int value, int min, int max, String name)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bename
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static int checkInsideRange(int value, int min, int max)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bevalue
public static long checkInsideRange(long value, long min, long max, String name)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bename
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static long checkInsideRange(long value, long min, long max)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bevalue
public static float checkInsideRange(float value, float min, float max, float epsilon, String name)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
. The
epsilon
is used to determine if value
is equal to
min
or max
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can beepsilon
- the acceptable margin of error when checking if
value
is equal to min
or max
name
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(float, float, float)
,
FloatingPoint.lessThanOrEqual(float, float, float)
public static float checkInsideRange(float value, float min, float max, float epsilon)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
. The
epsilon
is used to determine if value
is equal to
min
or max
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can beepsilon
- the acceptable margin of error when checking if
value
is equal to min
or max
value
FloatingPoint.greaterThanOrEqual(float, float, float)
,
FloatingPoint.lessThanOrEqual(float, float, float)
public static float checkInsideRange(float value, float min, float max, String name)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
. This will
use FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to
determine if value
is equal to min
or max
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bename
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(float, float)
,
FloatingPoint.lessThanOrEqual(float, float)
public static float checkInsideRange(float value, float min, float max)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
. This will
use FloatingPoint.EPSILON_DEFAULT_FLOAT
as the epsilon to
determine if value
is equal to min
or max
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bevalue
FloatingPoint.greaterThanOrEqual(float, float)
,
FloatingPoint.lessThanOrEqual(float, float)
public static double checkInsideRange(double value, double min, double max, double epsilon, String name)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
. The
epsilon
is used to determine if value
is equal to
min
or max
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can beepsilon
- the acceptable margin of error when checking if
value
is equal to min
or max
name
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(double, double, double)
,
FloatingPoint.lessThanOrEqual(double, double, double)
public static double checkInsideRange(double value, double min, double max, double epsilon)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
. The
epsilon
is used to determine if value
is equal to
min
or max
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can beepsilon
- the acceptable margin of error when checking if
value
is equal to min
or max
value
FloatingPoint.greaterThanOrEqual(double, double, double)
,
FloatingPoint.lessThanOrEqual(double, double, double)
public static double checkInsideRange(double value, double min, double max, String name)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
. This will
use FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
is equal to min
or max
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bename
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(double, double)
,
FloatingPoint.lessThanOrEqual(double, double)
public static double checkInsideRange(double value, double min, double max)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
. This will
use FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the epsilon to
determine if value
is equal to min
or max
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bevalue
FloatingPoint.greaterThanOrEqual(double, double)
,
FloatingPoint.lessThanOrEqual(double, double)
public static char checkInsideRange(char value, char min, char max, String name)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
.value
- the value to checkmin
- the minimum (inclusive) that value
can bemax
- the maximum (inclusive) that value
can bename
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static char checkInsideRange(char value, char min, char max)
value
if it is inside the specified range, which means
greater than or equal to min
and less than or equal to
max
. If not, throws IllegalArgumentException
.value
- the value to checkmin
- the minimum that value
can bemax
- the maximum that value
can bevalue
public static byte checkPercent(byte value, String name)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static byte checkPercent(byte value)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.value
- the value to checkvalue
public static short checkPercent(short value, String name)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static short checkPercent(short value)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.value
- the value to checkvalue
public static int checkPercent(int value, String name)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static int checkPercent(int value)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.value
- the value to checkvalue
public static long checkPercent(long value, String name)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
public static long checkPercent(long value)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.value
- the value to checkvalue
public static float checkPercent(float value, float epsilon, String name)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.
The epsilon
is used to determine if value
is equal to 0
or 100.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0 or 100name
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(float, float, float)
,
FloatingPoint.lessThanOrEqual(float, float, float)
public static float checkPercent(float value, float epsilon)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.
The epsilon
is used to determine if value
is equal to 0
or 100.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0 or 100value
FloatingPoint.greaterThanOrEqual(float, float, float)
,
FloatingPoint.lessThanOrEqual(float, float, float)
public static float checkPercent(float value, String name)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.
This will use FloatingPoint.EPSILON_DEFAULT_FLOAT
as the
epsilon to determine if value
is equal to 0 or 100.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(float, float)
,
FloatingPoint.lessThanOrEqual(float, float)
public static float checkPercent(float value)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.
This will use FloatingPoint.EPSILON_DEFAULT_FLOAT
as the
epsilon to determine if value
is equal to 0 or 100.value
- the value to checkvalue
FloatingPoint.greaterThanOrEqual(float, float)
,
FloatingPoint.lessThanOrEqual(float, float)
public static double checkPercent(double value, double epsilon, String name)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.
The epsilon
is used to determine if value
is equal to 0
or 100.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0 or 100name
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(double, double, double)
,
FloatingPoint.lessThanOrEqual(double, double, double)
public static double checkPercent(double value, double epsilon)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.
The epsilon
is used to determine if value
is equal to 0
or 100.value
- the value to checkepsilon
- the acceptable margin of error when checking if
value
is equal to 0 or 100value
FloatingPoint.greaterThanOrEqual(double, double, double)
,
FloatingPoint.lessThanOrEqual(double, double, double)
public static double checkPercent(double value, String name)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.
This will use FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the
epsilon to determine if value
is equal to 0 or 100.value
- the value to checkname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagevalue
FloatingPoint.greaterThanOrEqual(double, double)
,
FloatingPoint.lessThanOrEqual(double, double)
public static double checkPercent(double value)
value
if it is a valid percent, which means between 0
and 100 (inclusive). If not, throws IllegalArgumentException
.
This will use FloatingPoint.EPSILON_DEFAULT_DOUBLE
as the
epsilon to determine if value
is equal to 0 or 100.value
- the value to checkvalue
FloatingPoint.greaterThanOrEqual(double, double)
,
FloatingPoint.lessThanOrEqual(double, double)
public static byte[] checkLength(byte[] array, int length, String name)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagearray
public static byte[] checkLength(byte[] array, int length)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalarray
public static short[] checkLength(short[] array, int length, String name)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagearray
public static short[] checkLength(short[] array, int length)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalarray
public static int[] checkLength(int[] array, int length, String name)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagearray
public static int[] checkLength(int[] array, int length)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalarray
public static long[] checkLength(long[] array, int length, String name)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagearray
public static long[] checkLength(long[] array, int length)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalarray
public static float[] checkLength(float[] array, int length, String name)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagearray
public static float[] checkLength(float[] array, int length)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalarray
public static double[] checkLength(double[] array, int length, String name)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagearray
public static double[] checkLength(double[] array, int length)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalarray
public static char[] checkLength(char[] array, int length, String name)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagearray
public static char[] checkLength(char[] array, int length)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalarray
public static boolean[] checkLength(boolean[] array, int length, String name)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagearray
public static boolean[] checkLength(boolean[] array, int length)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalarray
public static <T> T[] checkLength(T[] array, int length, String name)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.T
- the type of arrayarray
- the array to checklength
- the length that array
's length must equalname
- the name of the argument to be included in the detail
message of the IllegalArgumentException
if it is thrown, or
null
for no detail messagearray
public static <T> T[] checkLength(T[] array, int length)
array
if it's not null
and its length equals
length
, otherwise throws IllegalArgumentException
.T
- the type of arrayarray
- the array to checklength
- the length that array
's length must equalarray
Copyright © 2022 Frostphyr. All rights reserved.