public enum ValueRangeComparison extends Enum<ValueRangeComparison>
| Enum Constant and Description |
|---|
ABOVE_MAXIMUM
The number is larger than the maximum value of the range.
|
BELOW_MINIMUM
The number is smaller than the minimum value of the range.
|
UNSUPPORTED_NAN
The number is
NaN (Not-a-Number), which is not supported by the target type. |
UNSUPPORTED_NEGATIVE_INFINITY
The number is negative infinity, which is not supported by the target type.
|
UNSUPPORTED_POSITIVE_INFINITY
The number is positive infinity, which is not supported by the target type.
|
WITHIN_RANGE
The number is within the value range, i.e.
|
| Modifier and Type | Method and Description |
|---|---|
static Optional<ValueRangeComparison> |
getErrorForNonFiniteValue(double value)
Returns the appropriate "Unsupported" comparison entry if the given double represents a non-finite value
from Float or Double.
|
static Optional<ValueRangeComparison> |
getErrorForNonFiniteValue(Number number)
Returns the appropriate "Unsupported" comparison entry if the given number represents a non-finite value
from Float or Double.
|
boolean |
isTooLarge() |
boolean |
isTooSmall() |
boolean |
isUnsupportedInfinity() |
boolean |
isUnsupportedNonFiniteValue() |
static ValueRangeComparison |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ValueRangeComparison[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ValueRangeComparison WITHIN_RANGE
public static final ValueRangeComparison BELOW_MINIMUM
public static final ValueRangeComparison ABOVE_MAXIMUM
public static final ValueRangeComparison UNSUPPORTED_POSITIVE_INFINITY
public static final ValueRangeComparison UNSUPPORTED_NEGATIVE_INFINITY
public static final ValueRangeComparison UNSUPPORTED_NAN
NaN (Not-a-Number), which is not supported by the target type.public static ValueRangeComparison[] values()
for (ValueRangeComparison c : ValueRangeComparison.values()) System.out.println(c);
public static ValueRangeComparison valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static Optional<ValueRangeComparison> getErrorForNonFiniteValue(Number number)
number - the number to processpublic static Optional<ValueRangeComparison> getErrorForNonFiniteValue(double value)
value - the number to processpublic boolean isTooSmall()
public boolean isTooLarge()
public boolean isUnsupportedInfinity()
public boolean isUnsupportedNonFiniteValue()
Copyright © 2023. All rights reserved.