public final class Argument extends Object
Modifier and Type | Method and Description |
---|---|
static byte |
checkGreaterThan(byte value,
byte number)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static byte |
checkGreaterThan(byte value,
byte number,
String message)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static char |
checkGreaterThan(char value,
char number)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static char |
checkGreaterThan(char value,
char number,
String message)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static double |
checkGreaterThan(double value,
double number)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static double |
checkGreaterThan(double value,
double number,
String message)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static float |
checkGreaterThan(float value,
float number)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static float |
checkGreaterThan(float value,
float number,
String message)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static int |
checkGreaterThan(int value,
int number)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static int |
checkGreaterThan(int value,
int number,
String message)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static long |
checkGreaterThan(long value,
long number)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static long |
checkGreaterThan(long value,
long number,
String message)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static short |
checkGreaterThan(short value,
short number)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static short |
checkGreaterThan(short value,
short number,
String message)
Returns the specified
value if it is greater than the specified
number , otherwise throws IllegalArgumentException . |
static byte |
checkGreaterThanOrEqual(byte value,
byte number)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static byte |
checkGreaterThanOrEqual(byte value,
byte number,
String message)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static char |
checkGreaterThanOrEqual(char value,
char number)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static char |
checkGreaterThanOrEqual(char value,
char number,
String message)
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)
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,
String message)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static float |
checkGreaterThanOrEqual(float value,
float number)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static float |
checkGreaterThanOrEqual(float value,
float number,
String message)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static int |
checkGreaterThanOrEqual(int value,
int number)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static int |
checkGreaterThanOrEqual(int value,
int number,
String message)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static long |
checkGreaterThanOrEqual(long value,
long number)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static long |
checkGreaterThanOrEqual(long value,
long number,
String message)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static short |
checkGreaterThanOrEqual(short value,
short number)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static short |
checkGreaterThanOrEqual(short value,
short number,
String message)
Returns the specified
value if it is greater than or equal to
the specified number , otherwise throws
IllegalArgumentException . |
static byte |
checkInsideRange(byte value,
byte min,
byte max)
Returns the specified
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 message)
Returns the specified
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 the specified
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 message)
Returns the specified
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 the specified
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 message)
Returns the specified
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 the specified
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 message)
Returns the specified
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 the specified
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 message)
Returns the specified
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 the specified
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 message)
Returns the specified
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 the specified
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 message)
Returns the specified
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 the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static boolean[] |
checkLength(boolean[] array,
int length,
String message)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static byte[] |
checkLength(byte[] array,
int length)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static byte[] |
checkLength(byte[] array,
int length,
String message)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static char[] |
checkLength(char[] array,
int length)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static char[] |
checkLength(char[] array,
int length,
String message)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static double[] |
checkLength(double[] array,
int length)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static double[] |
checkLength(double[] array,
int length,
String message)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static float[] |
checkLength(float[] array,
int length)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static float[] |
checkLength(float[] array,
int length,
String message)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static int[] |
checkLength(int[] array,
int length)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static int[] |
checkLength(int[] array,
int length,
String message)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static long[] |
checkLength(long[] array,
int length)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static long[] |
checkLength(long[] array,
int length,
String message)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static short[] |
checkLength(short[] array,
int length)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static short[] |
checkLength(short[] array,
int length,
String message)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static <T> T[] |
checkLength(T[] array,
int length)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static <T> T[] |
checkLength(T[] array,
int length,
String message)
Returns the specified
array if it's not null and its
length equals the specified length , otherwise throws
IllegalArgumentException . |
static byte |
checkLessThan(byte value,
byte number)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static byte |
checkLessThan(byte value,
byte number,
String message)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static char |
checkLessThan(char value,
char number)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static char |
checkLessThan(char value,
char number,
String message)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static double |
checkLessThan(double value,
double number)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static double |
checkLessThan(double value,
double number,
String message)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static float |
checkLessThan(float value,
float number)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static float |
checkLessThan(float value,
float number,
String message)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static int |
checkLessThan(int value,
int number)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static int |
checkLessThan(int value,
int number,
String message)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static long |
checkLessThan(long value,
long number)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static long |
checkLessThan(long value,
long number,
String message)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static short |
checkLessThan(short value,
short number)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static short |
checkLessThan(short value,
short number,
String message)
Returns the specified
value if it is less than the specified
number , otherwise throws IllegalArgumentException . |
static byte |
checkLessThanOrEqual(byte value,
byte number)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static byte |
checkLessThanOrEqual(byte value,
byte number,
String message)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static char |
checkLessThanOrEqual(char value,
char number)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static char |
checkLessThanOrEqual(char value,
char number,
String message)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static double |
checkLessThanOrEqual(double value,
double number)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static double |
checkLessThanOrEqual(double value,
double number,
String message)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static float |
checkLessThanOrEqual(float value,
float number)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static float |
checkLessThanOrEqual(float value,
float number,
String message)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static int |
checkLessThanOrEqual(int value,
int number)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static int |
checkLessThanOrEqual(int value,
int number,
String message)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static long |
checkLessThanOrEqual(long value,
long number)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static long |
checkLessThanOrEqual(long value,
long number,
String message)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static short |
checkLessThanOrEqual(short value,
short number)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static short |
checkLessThanOrEqual(short value,
short number,
String message)
Returns the specified
value if it is less than or equal to the
specified number , otherwise throws
IllegalArgumentException . |
static byte |
checkNegative(byte value)
Returns the specified
value if it is negative, which means less
than 0. |
static byte |
checkNegative(byte value,
String message)
Returns the specified
value if it is negative, which means less
than 0. |
static double |
checkNegative(double value)
Returns the specified
value if it is negative, which means less
than 0. |
static double |
checkNegative(double value,
String message)
Returns the specified
value if it is negative, which means less
than 0. |
static float |
checkNegative(float value)
Returns the specified
value if it is negative, which means less
than 0. |
static float |
checkNegative(float value,
String message)
Returns the specified
value if it is negative, which means less
than 0. |
static int |
checkNegative(int value)
Returns the specified
value if it is negative, which means less
than 0. |
static int |
checkNegative(int value,
String message)
Returns the specified
value if it is negative, which means less
than 0. |
static long |
checkNegative(long value)
Returns the specified
value if it is negative, which means less
than 0. |
static long |
checkNegative(long value,
String message)
Returns the specified
value if it is negative, which means less
than 0. |
static short |
checkNegative(short value)
Returns the specified
value if it is negative, which means less
than 0. |
static short |
checkNegative(short value,
String message)
Returns the specified
value if it is negative, which means less
than 0. |
static <T> T |
checkNotNull(T value)
|
static <T> T |
checkNotNull(T value,
String message)
|
static byte |
checkPercent(byte value)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static byte |
checkPercent(byte value,
String message)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static double |
checkPercent(double value)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static double |
checkPercent(double value,
String message)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static float |
checkPercent(float value)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static float |
checkPercent(float value,
String message)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static int |
checkPercent(int value)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static int |
checkPercent(int value,
String message)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static long |
checkPercent(long value)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static long |
checkPercent(long value,
String message)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static short |
checkPercent(short value)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static short |
checkPercent(short value,
String message)
Returns the specified
value if it is a valid percent, which
means between 0 and 100. |
static byte |
checkPositive(byte value)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
static byte |
checkPositive(byte value,
String message)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
static double |
checkPositive(double value)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
static double |
checkPositive(double value,
String message)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
static float |
checkPositive(float value)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
static float |
checkPositive(float value,
String message)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
static int |
checkPositive(int value)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
static int |
checkPositive(int value,
String message)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
static long |
checkPositive(long value)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
static long |
checkPositive(long value,
String message)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
static short |
checkPositive(short value)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
static short |
checkPositive(short value,
String message)
Returns the specified
value if it is positive, which means
greater than or equal to 0. |
public static <T> T checkNotNull(T value, String message)
T
- the type of the valuevalue
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 message)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static byte checkGreaterThan(byte value, byte number)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanvalue
public static short checkGreaterThan(short value, short number, String message)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static short checkGreaterThan(short value, short number)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanvalue
public static int checkGreaterThan(int value, int number, String message)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static int checkGreaterThan(int value, int number)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanvalue
public static long checkGreaterThan(long value, long number, String message)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static long checkGreaterThan(long value, long number)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanvalue
public static float checkGreaterThan(float value, float number, String message)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static float checkGreaterThan(float value, float number)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanvalue
public static double checkGreaterThan(double value, double number, String message)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static double checkGreaterThan(double value, double number)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanvalue
public static char checkGreaterThan(char value, char number, String message)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static char checkGreaterThan(char value, char number)
value
if it is greater than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater thanvalue
public static byte checkGreaterThanOrEqual(byte value, byte number, String message)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static byte checkGreaterThanOrEqual(byte value, byte number)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.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 message)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static short checkGreaterThanOrEqual(short value, short number)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.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 message)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static int checkGreaterThanOrEqual(int value, int number)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.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 message)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static long checkGreaterThanOrEqual(long value, long number)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater than or
equal tovalue
public static float checkGreaterThanOrEqual(float value, float number, String message)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static float checkGreaterThanOrEqual(float value, float number)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater than or
equal tovalue
public static double checkGreaterThanOrEqual(double value, double number, String message)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static double checkGreaterThanOrEqual(double value, double number)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater than or
equal tovalue
public static char checkGreaterThanOrEqual(char value, char number, String message)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be greater than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static char checkGreaterThanOrEqual(char value, char number)
value
if it is greater than or equal to
the specified number
, otherwise throws
IllegalArgumentException
.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 message)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static byte checkLessThan(byte value, byte number)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanvalue
public static short checkLessThan(short value, short number, String message)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static short checkLessThan(short value, short number)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanvalue
public static int checkLessThan(int value, int number, String message)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static int checkLessThan(int value, int number)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanvalue
public static long checkLessThan(long value, long number, String message)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static long checkLessThan(long value, long number)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanvalue
public static float checkLessThan(float value, float number, String message)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static float checkLessThan(float value, float number)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanvalue
public static double checkLessThan(double value, double number, String message)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static double checkLessThan(double value, double number)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanvalue
public static char checkLessThan(char value, char number, String message)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static char checkLessThan(char value, char number)
value
if it is less than the specified
number
, otherwise throws IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less thanvalue
public static byte checkLessThanOrEqual(byte value, byte number, String message)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static byte checkLessThanOrEqual(byte value, byte number)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.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 message)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static short checkLessThanOrEqual(short value, short number)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.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 message)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static int checkLessThanOrEqual(int value, int number)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.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 message)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static long checkLessThanOrEqual(long value, long number)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less than or
equal tovalue
public static float checkLessThanOrEqual(float value, float number, String message)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static float checkLessThanOrEqual(float value, float number)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less than or
equal tovalue
public static double checkLessThanOrEqual(double value, double number, String message)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static double checkLessThanOrEqual(double value, double number)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less than or
equal tovalue
public static char checkLessThanOrEqual(char value, char number, String message)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less than or
equal tomessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static char checkLessThanOrEqual(char value, char number)
value
if it is less than or equal to the
specified number
, otherwise throws
IllegalArgumentException
.value
- the value to checknumber
- the number that value
must be less than or
equal tovalue
public static byte checkPositive(byte value, String message)
value
if it is positive, which means
greater than or equal to 0. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 message)
value
if it is positive, which means
greater than or equal to 0. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 message)
value
if it is positive, which means
greater than or equal to 0. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 message)
value
if it is positive, which means
greater than or equal to 0. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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, String message)
value
if it is positive, which means
greater than or equal to 0. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static float checkPositive(float 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 double checkPositive(double value, String message)
value
if it is positive, which means
greater than or equal to 0. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static double checkPositive(double 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 byte checkNegative(byte value, String message)
value
if it is negative, which means less
than 0. If not, throws IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 message)
value
if it is negative, which means less
than 0. If not, throws IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 message)
value
if it is negative, which means less
than 0. If not, throws IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 message)
value
if it is negative, which means less
than 0. If not, throws IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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, String message)
value
if it is negative, which means less
than 0. If not, throws IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static float checkNegative(float value)
value
if it is negative, which means less
than 0. If not, throws IllegalArgumentException
.value
- the value to checkvalue
public static double checkNegative(double value, String message)
value
if it is negative, which means less
than 0. If not, throws IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static double checkNegative(double value)
value
if it is negative, which means less
than 0. If not, throws IllegalArgumentException
.value
- the value to checkvalue
public static byte checkInsideRange(byte value, byte min, byte max, String message)
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 bemessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 that value
can bemax
- the maximum that value
can bevalue
public static short checkInsideRange(short value, short min, short max, String message)
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 bemessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 that value
can bemax
- the maximum that value
can bevalue
public static int checkInsideRange(int value, int min, int max, String message)
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 bemessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 that value
can bemax
- the maximum that value
can bevalue
public static long checkInsideRange(long value, long min, long max, String message)
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 bemessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 that value
can bemax
- the maximum that value
can bevalue
public static float checkInsideRange(float value, float min, float max, String message)
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 bemessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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
.value
- the value to checkmin
- the minimum that value
can bemax
- the maximum that value
can bevalue
public static double checkInsideRange(double value, double min, double max, String message)
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 bemessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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
.value
- the value to checkmin
- the minimum that value
can bemax
- the maximum that value
can bevalue
public static char checkInsideRange(char value, char min, char max, String message)
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 bemessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
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 message)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static byte checkPercent(byte value)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkvalue
public static short checkPercent(short value, String message)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static short checkPercent(short value)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkvalue
public static int checkPercent(int value, String message)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static int checkPercent(int value)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkvalue
public static long checkPercent(long value, String message)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static long checkPercent(long value)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkvalue
public static float checkPercent(float value, String message)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static float checkPercent(float value)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkvalue
public static double checkPercent(double value, String message)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkmessage
- the detail message for the
IllegalArgumentException
if it's thrownvalue
public static double checkPercent(double value)
value
if it is a valid percent, which
means between 0 and 100. If not, throws
IllegalArgumentException
.value
- the value to checkvalue
public static byte[] checkLength(byte[] array, int length, String message)
array
if it's not null
and its
length equals the specified length
, otherwise throws
IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalmessage
- the detail message for the
IllegalArgumentException
if it's thrownarray
public static byte[] checkLength(byte[] array, int length)
array
if it's not null
and its
length equals the specified 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 message)
array
if it's not null
and its
length equals the specified length
, otherwise throws
IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalmessage
- the detail message for the
IllegalArgumentException
if it's thrownarray
public static short[] checkLength(short[] array, int length)
array
if it's not null
and its
length equals the specified 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 message)
array
if it's not null
and its
length equals the specified length
, otherwise throws
IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalmessage
- the detail message for the
IllegalArgumentException
if it's thrownarray
public static int[] checkLength(int[] array, int length)
array
if it's not null
and its
length equals the specified 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 message)
array
if it's not null
and its
length equals the specified length
, otherwise throws
IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalmessage
- the detail message for the
IllegalArgumentException
if it's thrownarray
public static long[] checkLength(long[] array, int length)
array
if it's not null
and its
length equals the specified 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 message)
array
if it's not null
and its
length equals the specified length
, otherwise throws
IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalmessage
- the detail message for the
IllegalArgumentException
if it's thrownarray
public static float[] checkLength(float[] array, int length)
array
if it's not null
and its
length equals the specified 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 message)
array
if it's not null
and its
length equals the specified length
, otherwise throws
IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalmessage
- the detail message for the
IllegalArgumentException
if it's thrownarray
public static double[] checkLength(double[] array, int length)
array
if it's not null
and its
length equals the specified 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 message)
array
if it's not null
and its
length equals the specified length
, otherwise throws
IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalmessage
- the detail message for the
IllegalArgumentException
if it's thrownarray
public static char[] checkLength(char[] array, int length)
array
if it's not null
and its
length equals the specified 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 message)
array
if it's not null
and its
length equals the specified length
, otherwise throws
IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalmessage
- the detail message for the
IllegalArgumentException
if it's thrownarray
public static boolean[] checkLength(boolean[] array, int length)
array
if it's not null
and its
length equals the specified 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 message)
array
if it's not null
and its
length equals the specified length
, otherwise throws
IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalmessage
- the detail message for the
IllegalArgumentException
if it's thrownarray
public static <T> T[] checkLength(T[] array, int length)
array
if it's not null
and its
length equals the specified length
, otherwise throws
IllegalArgumentException
.array
- the array to checklength
- the length that array
's length must equalarray
Copyright © 2021 Frostphyr. All rights reserved.