public final class NumberMatchers
extends java.lang.Object
DoubleMath,
UberMatchers| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<java.lang.Number> |
between(java.lang.Number min,
java.lang.Number max)
Matcher equivalent of the
DoubleMath.compare(double, double) for two bound arguments. |
static org.hamcrest.Matcher<java.lang.Number> |
betweenOrEqual(java.lang.Number min,
java.lang.Number max)
Matcher equivalent of the
DoubleMath.compare(double, double) for two bound arguments. |
static org.hamcrest.Matcher<java.lang.Number> |
equalTo(java.lang.Number value)
Matcher equivalent of the
DoubleMath.equals(Double, Double). |
static org.hamcrest.Matcher<java.lang.Double> |
finite()
Matcher equivalent of the
DoubleMath.isFinite(Double). |
static org.hamcrest.Matcher<java.lang.Number> |
greaterThan(java.lang.Number value)
Matcher equivalent of the
DoubleMath.compare(double, double). |
static org.hamcrest.Matcher<java.lang.Number> |
greaterThanOrEqual(java.lang.Number value)
Matcher equivalent of the
DoubleMath.compare(double, double). |
static org.hamcrest.Matcher<java.lang.Number> |
lowerThan(java.lang.Number value)
Matcher equivalent of the
DoubleMath.compare(double, double). |
static org.hamcrest.Matcher<java.lang.Number> |
lowerThanOrEqual(java.lang.Number value)
Matcher equivalent of the
DoubleMath.compare(double, double). |
static org.hamcrest.Matcher<java.lang.Number> |
negative()
Matcher equivalent of the
DoubleMath.isNegative(Double). |
static org.hamcrest.Matcher<java.lang.Double> |
number()
Matcher equivalent of the
DoubleMath.isNumber(Double). |
static org.hamcrest.Matcher<java.lang.Number> |
positive()
Matcher equivalent of the
DoubleMath.isPositive(Double). |
static org.hamcrest.Matcher<java.lang.Number> |
zero()
Matcher equivalent of the
DoubleMath.isZero(Double). |
public static org.hamcrest.Matcher<java.lang.Double> number()
DoubleMath.isNumber(Double).
Matches if item is not null and not Double.NaNpublic static org.hamcrest.Matcher<java.lang.Double> finite()
DoubleMath.isFinite(Double).
Matches if item is not null, not Double.NaN, and is finite.public static org.hamcrest.Matcher<java.lang.Number> zero()
DoubleMath.isZero(Double).
Matches if item is not null and equal to 0.0.public static org.hamcrest.Matcher<java.lang.Number> positive()
Matcher equivalent of the DoubleMath.isPositive(Double).
Matches if item is number and greater than 0.0.
public static org.hamcrest.Matcher<java.lang.Number> negative()
DoubleMath.isNegative(Double).
Matches if item is number and lower than 0.0.public static org.hamcrest.Matcher<java.lang.Number> equalTo(java.lang.Number value)
DoubleMath.equals(Double, Double).
Matches if item is double-equal to the specified number value.public static org.hamcrest.Matcher<java.lang.Number> greaterThan(java.lang.Number value)
DoubleMath.compare(double, double).
Matches if item is not-null, and double-greater than specified number value.java.lang.NullPointerException - if specified value is nullpublic static org.hamcrest.Matcher<java.lang.Number> lowerThan(java.lang.Number value)
DoubleMath.compare(double, double).
Matches if item is not-null, and double-lower than specified number value.java.lang.NullPointerException - if specified value is nullpublic static org.hamcrest.Matcher<java.lang.Number> greaterThanOrEqual(java.lang.Number value)
DoubleMath.compare(double, double).
Matches if item is not-null, and double-greater than or double-equal to the specified number value.java.lang.NullPointerException - if specified value is nullpublic static org.hamcrest.Matcher<java.lang.Number> lowerThanOrEqual(java.lang.Number value)
DoubleMath.compare(double, double).
Matches if item is not-null, and double-lower than or double-equal to the specified number value.java.lang.NullPointerException - if specified value is nullpublic static org.hamcrest.Matcher<java.lang.Number> between(java.lang.Number min,
java.lang.Number max)
DoubleMath.compare(double, double) for two bound arguments.
Matches if item is double-greater than first specified number,
or double-greater than second specified argument.java.lang.NullPointerException - if either specified value is nulljava.lang.IllegalArgumentException - if specified min is greater than specified maxpublic static org.hamcrest.Matcher<java.lang.Number> betweenOrEqual(java.lang.Number min,
java.lang.Number max)
DoubleMath.compare(double, double) for two bound arguments.
Matches if item is double-greater than first specified number,
or double-greater than second specified argument, or double-equal to any of them.java.lang.NullPointerException - if either specified value is nulljava.lang.IllegalArgumentException - if specified min is greater than specified max