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 char |
checkGreaterThan(char value,
char number)
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 float |
checkGreaterThan(float value,
float number)
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 long |
checkGreaterThan(long value,
long number)
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 byte |
checkLessThan(byte value,
byte number)
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 double |
checkLessThan(double value,
double number)
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 int |
checkLessThan(int value,
int number)
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 short |
checkLessThan(short value,
short number)
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 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 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 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 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 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 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 byte |
checkNegative(byte value)
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 float |
checkNegative(float value)
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 long |
checkNegative(long value)
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 <T> T |
checkNotNull(T value)
|
static byte |
checkPercent(byte value)
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 float |
checkPercent(float value)
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 long |
checkPercent(long value)
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 byte |
checkPositive(byte value)
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 float |
checkPositive(float value)
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 long |
checkPositive(long value)
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. |
public static <T> T checkNotNull(T value)
T - the type of the valuevalue - the value to checkvaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 tovaluepublic 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 tovaluepublic 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 tovaluepublic 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 tovaluepublic 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 tovaluepublic 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 tovaluepublic 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 tovaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 thanvaluepublic 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 tovaluepublic 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 tovaluepublic 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 tovaluepublic 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 tovaluepublic 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 tovaluepublic 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 tovaluepublic 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 tovaluepublic 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 checkvaluepublic 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 checkvaluepublic 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 checkvaluepublic 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 checkvaluepublic 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 checkvaluepublic 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 checkvaluepublic static byte checkNegative(byte value)
value if it is negative, which means less
than 0. If not, throws IllegalArgumentException.value - the value to checkvaluepublic static short checkNegative(short value)
value if it is negative, which means less
than 0. If not, throws IllegalArgumentException.value - the value to checkvaluepublic static int checkNegative(int value)
value if it is negative, which means less
than 0. If not, throws IllegalArgumentException.value - the value to checkvaluepublic static long checkNegative(long value)
value if it is negative, which means less
than 0. If not, throws IllegalArgumentException.value - the value to checkvaluepublic static float checkNegative(float value)
value if it is negative, which means less
than 0. If not, throws IllegalArgumentException.value - the value to checkvaluepublic static double checkNegative(double value)
value if it is negative, which means less
than 0. If not, throws IllegalArgumentException.value - the value to checkvaluepublic 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 bevaluepublic 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 bevaluepublic 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 bevaluepublic 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 bevaluepublic 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 bevaluepublic 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 bevaluepublic 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 bevaluepublic 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 checkvaluepublic 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 checkvaluepublic 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 checkvaluepublic 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 checkvaluepublic 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 checkvaluepublic 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 checkvalueCopyright © 2020 Frostphyr. All rights reserved.