public abstract class NumericArgs
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static double |
requireGreaterThan(java.lang.Double value,
double other,
java.lang.String message)
Require that the given value is greater than another value (value > other)
|
static float |
requireGreaterThan(java.lang.Float value,
float other,
java.lang.String message)
Require that the given value is greater than another value (value > other)
|
static int |
requireGreaterThan(java.lang.Integer value,
int other,
java.lang.String message)
Require that the given value is greater than another value (value > other)
|
static long |
requireGreaterThan(java.lang.Long value,
long other,
java.lang.String message)
Require that the given value is greater than another value (value > other)
|
static double |
requireGreaterThanEquals(java.lang.Double value,
double other,
java.lang.String message)
Require that the given value is greater than or equals to another value (value >= other)
|
static float |
requireGreaterThanEquals(java.lang.Float value,
float other,
java.lang.String message)
Require that the given value is greater than or equals to another value (value >= other)
|
static int |
requireGreaterThanEquals(java.lang.Integer value,
int other,
java.lang.String message)
Require that the given value is greater than or equals to another value (value >= other)
|
static long |
requireGreaterThanEquals(java.lang.Long value,
long other,
java.lang.String message)
Require that the given value is greater than or equals to another value (value >= other)
|
static double |
requireInRange(java.lang.Double value,
double from,
boolean fromInclusive,
double to,
boolean toInclusive,
java.lang.String message)
Require that the given value is in a given range
|
static float |
requireInRange(java.lang.Float value,
float from,
boolean fromInclusive,
float to,
boolean toInclusive,
java.lang.String message)
Require that the given value is in a given range
|
static int |
requireInRange(java.lang.Integer value,
int from,
boolean fromInclusive,
int to,
boolean toInclusive,
java.lang.String message)
Require that the given value is in a given range
|
static long |
requireInRange(java.lang.Long value,
long from,
boolean fromInclusive,
long to,
boolean toInclusive,
java.lang.String message)
Require that the given value is in a given range
|
static double |
requireInRangeExclusive(java.lang.Double value,
double from,
double to,
java.lang.String message)
Require that the given value is in a given range (exclusive)
|
static float |
requireInRangeExclusive(java.lang.Float value,
float from,
float to,
java.lang.String message)
Require that the given value is in a given range (exclusive)
|
static int |
requireInRangeExclusive(java.lang.Integer value,
int from,
int to,
java.lang.String message)
Require that the given value is in a given range (exclusive)
|
static long |
requireInRangeExclusive(java.lang.Long value,
long from,
long to,
java.lang.String message)
Require that the given value is in a given range (exclusive)
|
static double |
requireInRangeInclusive(java.lang.Double value,
double from,
double to,
java.lang.String message)
Require that the given value is in a given range (inclusive)
|
static float |
requireInRangeInclusive(java.lang.Float value,
float from,
float to,
java.lang.String message)
Require that the given value is in a given range (inclusive)
|
static int |
requireInRangeInclusive(java.lang.Integer value,
int from,
int to,
java.lang.String message)
Require that the given value is in a given range (inclusive)
|
static long |
requireInRangeInclusive(java.lang.Long value,
long from,
long to,
java.lang.String message)
Require that the given value is in a given range (inclusive)
|
static double |
requireLessThan(java.lang.Double value,
double other,
java.lang.String message)
Require that the given value is less than another value (value < other)
|
static float |
requireLessThan(java.lang.Float value,
float other,
java.lang.String message)
Require that the given value is less than another value (value < other)
|
static int |
requireLessThan(java.lang.Integer value,
int other,
java.lang.String message)
Require that the given value is less than another value (value < other)
|
static long |
requireLessThan(java.lang.Long value,
long other,
java.lang.String message)
Require that the given value is less than another value (value < other)
|
static double |
requireLessThanEquals(java.lang.Double value,
double other,
java.lang.String message)
Require that the given value is less than or equals to another value (value <= other)
|
static float |
requireLessThanEquals(java.lang.Float value,
float other,
java.lang.String message)
Require that the given value is less than or equals to another value (value <= other)
|
static int |
requireLessThanEquals(java.lang.Integer value,
int other,
java.lang.String message)
Require that the given value is less than or equals to another value (value <= other)
|
static long |
requireLessThanEquals(java.lang.Long value,
long other,
java.lang.String message)
Require that the given value is less than or equals to another value (value <= other)
|
static double |
requireNegative(java.lang.Double value,
java.lang.String message)
Require that the given value is negative (value < 0)
|
static float |
requireNegative(java.lang.Float value,
java.lang.String message)
Require that the given value is negative (value < 0)
|
static int |
requireNegative(java.lang.Integer value,
java.lang.String message)
Require that the given value is negative (value < 0)
|
static long |
requireNegative(java.lang.Long value,
java.lang.String message)
Require that the given value is negative (value < 0)
|
static double |
requireNonNegative(java.lang.Double value,
java.lang.String message)
Require that the given value is non-negative (value >= 0)
|
static float |
requireNonNegative(java.lang.Float value,
java.lang.String message)
Require that the given value is non-negative (value >= 0)
|
static int |
requireNonNegative(java.lang.Integer value,
java.lang.String message)
Require that the given value is non-negative (value >= 0)
|
static long |
requireNonNegative(java.lang.Long value,
java.lang.String message)
Require that the given value is non-negative (value >= 0)
|
static double |
requireNonPositive(java.lang.Double value,
java.lang.String message)
Require that the given value is non-positive (value <= 0)
|
static float |
requireNonPositive(java.lang.Float value,
java.lang.String message)
Require that the given value is non-positive (value <= 0)
|
static int |
requireNonPositive(java.lang.Integer value,
java.lang.String message)
Require that the given value is non-positive (value <= 0)
|
static long |
requireNonPositive(java.lang.Long value,
java.lang.String message)
Require that the given value is non-positive (value <= 0)
|
static double |
requireNonZero(java.lang.Double value,
java.lang.String message)
Require that the given value is not zero (value != 0)
|
static float |
requireNonZero(java.lang.Float value,
java.lang.String message)
Require that the given value is not zero (value != 0)
|
static int |
requireNonZero(java.lang.Integer value,
java.lang.String message)
Require that the given value is not zero (value != 0)
|
static long |
requireNonZero(java.lang.Long value,
java.lang.String message)
Require that the given value is not zero (value != 0)
|
static double |
requirePositive(java.lang.Double value,
java.lang.String message)
Require that the given value is positive (value > 0)
|
static float |
requirePositive(java.lang.Float value,
java.lang.String message)
Require that the given value is positive (value > 0)
|
static int |
requirePositive(java.lang.Integer value,
java.lang.String message)
Require that the given value is positive (value > 0)
|
static long |
requirePositive(java.lang.Long value,
java.lang.String message)
Require that the given value is positive (value > 0)
|
public static long requirePositive(java.lang.Long value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static long requireNonNegative(java.lang.Long value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static long requireGreaterThan(java.lang.Long value,
long other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static long requireGreaterThanEquals(java.lang.Long value,
long other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static long requireNegative(java.lang.Long value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static long requireNonPositive(java.lang.Long value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static long requireLessThan(java.lang.Long value,
long other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static long requireLessThanEquals(java.lang.Long value,
long other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static long requireNonZero(java.lang.Long value,
@Nonnull
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static long requireInRangeInclusive(java.lang.Long value,
long from,
long to,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the range (inclusive)to - the upper end of the range (inclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static long requireInRangeExclusive(java.lang.Long value,
long from,
long to,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the range (exclusive)to - the upper end of the range (exclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static long requireInRange(java.lang.Long value,
long from,
boolean fromInclusive,
long to,
boolean toInclusive,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the rangefromInclusive - whether the lower end is inclusive (or exclusive)to - the upper end of the rangetoInclusive - whether the upper end is inclusive (or exclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requirePositive(java.lang.Integer value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requireNonNegative(java.lang.Integer value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requireGreaterThan(java.lang.Integer value,
int other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requireGreaterThanEquals(java.lang.Integer value,
int other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requireNegative(java.lang.Integer value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requireNonPositive(java.lang.Integer value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requireLessThan(java.lang.Integer value,
int other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requireLessThanEquals(java.lang.Integer value,
int other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requireNonZero(java.lang.Integer value,
@Nonnull
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requireInRangeInclusive(java.lang.Integer value,
int from,
int to,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the range (inclusive)to - the upper end of the range (inclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requireInRangeExclusive(java.lang.Integer value,
int from,
int to,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the range (exclusive)to - the upper end of the range (exclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static int requireInRange(java.lang.Integer value,
int from,
boolean fromInclusive,
int to,
boolean toInclusive,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the rangefromInclusive - whether the lower end is inclusive (or exclusive)to - the upper end of the rangetoInclusive - whether the upper end is inclusive (or exclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requirePositive(java.lang.Double value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requireNonNegative(java.lang.Double value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requireGreaterThan(java.lang.Double value,
double other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requireGreaterThanEquals(java.lang.Double value,
double other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requireNegative(java.lang.Double value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requireNonPositive(java.lang.Double value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requireLessThan(java.lang.Double value,
double other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requireLessThanEquals(java.lang.Double value,
double other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requireNonZero(java.lang.Double value,
@Nonnull
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requireInRangeInclusive(java.lang.Double value,
double from,
double to,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the range (inclusive)to - the upper end of the range (inclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requireInRangeExclusive(java.lang.Double value,
double from,
double to,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the range (exclusive)to - the upper end of the range (exclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static double requireInRange(java.lang.Double value,
double from,
boolean fromInclusive,
double to,
boolean toInclusive,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the rangefromInclusive - whether the lower end is inclusive (or exclusive)to - the upper end of the rangetoInclusive - whether the upper end is inclusive (or exclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requirePositive(java.lang.Float value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requireNonNegative(java.lang.Float value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requireGreaterThan(java.lang.Float value,
float other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requireGreaterThanEquals(java.lang.Float value,
float other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requireNegative(java.lang.Float value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requireNonPositive(java.lang.Float value,
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requireLessThan(java.lang.Float value,
float other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requireLessThanEquals(java.lang.Float value,
float other,
@Nonnull
java.lang.String message)
value - the value to checkother - the other value to compare withmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requireNonZero(java.lang.Float value,
@Nonnull
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requireInRangeInclusive(java.lang.Float value,
float from,
float to,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the range (inclusive)to - the upper end of the range (inclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requireInRangeExclusive(java.lang.Float value,
float from,
float to,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the range (exclusive)to - the upper end of the range (exclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirementpublic static float requireInRange(java.lang.Float value,
float from,
boolean fromInclusive,
float to,
boolean toInclusive,
@Nonnull
java.lang.String message)
value - the value to checkfrom - the lower end of the rangefromInclusive - whether the lower end is inclusive (or exclusive)to - the upper end of the rangetoInclusive - whether the upper end is inclusive (or exclusive)message - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirement