public final class BigDecimalMatchers
extends java.lang.Object
Matchers specialized on BigDecimal objects.| Modifier and Type | Method and Description |
|---|---|
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasNormalizedPrecision(int expectedPrecision)
Creates a matcher that matches if the examined object is a
BigDecimal whose normalized precision
(i.e. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasNormalizedPrecision(org.hamcrest.Matcher<? super java.lang.Integer> precisionMatcher)
Creates a matcher that matches if the examined object is a
BigDecimal whose normalized precision
(i.e. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasNormalizedScale(int expectedScale)
Creates a matcher that matches if the examined object is a
BigDecimal whose normalized scale
(i.e. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasNormalizedScale(org.hamcrest.Matcher<? super java.lang.Integer> scaleMatcher)
Creates a matcher that matches if the examined object is a
BigDecimal whose normalized scale
(i.e. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasPrecision(int expectedPrecision)
Creates a matcher that matches if the examined object is a
BigDecimal whose precision is equal
to the argument. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasPrecision(org.hamcrest.Matcher<? super java.lang.Integer> precisionMatcher)
Creates a matcher that matches if the examined object is a
BigDecimal whose precision satisfies
the matcher provided as an argument. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasRoundedValue(int scale,
java.math.RoundingMode roundingMode,
java.math.BigDecimal expectedValue)
Creates a matcher that matches if the examined object is a
BigDecimal that, when rounded to the
given scale using the specified rounding mode, numerically equals to the provided value. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasRoundedValue(int scale,
java.math.RoundingMode roundingMode,
org.hamcrest.Matcher<? super java.math.BigDecimal> matcher)
Creates a matcher that matches if the examined object is a
BigDecimal that, when rounded to the
given scale using the specified rounding mode, satisfies the provided matcher. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasRoundedValue(java.math.RoundingMode roundingMode,
java.math.BigDecimal expectedValue)
Creates a matcher that matches if the examined object is a
BigDecimal that, when rounded to the
scale 0 using the specified rounding mode, numerically equals to the provided value. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasRoundedValue(java.math.RoundingMode roundingMode,
org.hamcrest.Matcher<? super java.math.BigDecimal> matcher)
Creates a matcher that matches if the examined object is a
BigDecimal that, when rounded to the
scale 0 using the specified rounding mode, satisfies the provided matcher. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasScale(int expectedScale)
Creates a matcher that matches if the examined object is a
BigDecimal whose scale is equal
to the argument. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasScale(org.hamcrest.Matcher<? super java.lang.Integer> scaleMatcher)
Creates a matcher that matches if the examined object is a
BigDecimal whose scale satisfies
the matcher provided as an argument. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
hasValue(java.math.BigDecimal num)
Creates a matcher that matches if the examined object is a
BigDecimal with the same numeric value
as the argument. |
static <T> org.hamcrest.Matcher<java.math.BigDecimal> |
isStrictlyEqualTo(java.math.BigDecimal num)
Creates a matcher that matches if the examined object is a
BigDecimal with the same numeric value
as the argument and both values have the identical scale. |
public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasValue(java.math.BigDecimal num)
BigDecimal with the same numeric value
as the argument. It is intended to replace org.hamcrest.Matchers.comparesEqualTo(), while being
more readable.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> isStrictlyEqualTo(java.math.BigDecimal num)
BigDecimal with the same numeric value
as the argument and both values have the identical scale. This means that this matcher behaves exactly
as BigDecimal.equals(Object), however it is intended as a more readable alternative.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasScale(org.hamcrest.Matcher<? super java.lang.Integer> scaleMatcher)
BigDecimal whose scale satisfies
the matcher provided as an argument. Notice that the scale reflects possible trailing zeros.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasScale(int expectedScale)
BigDecimal whose scale is equal
to the argument. Notice that the scale reflects possible trailing zeros.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasNormalizedScale(org.hamcrest.Matcher<? super java.lang.Integer> scaleMatcher)
BigDecimal whose normalized scale
(i.e. after trailing zeros removed) satisfies the matcher provided as an argument.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasNormalizedScale(int expectedScale)
BigDecimal whose normalized scale
(i.e. after trailing zeros removed) is equal to the argument.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasPrecision(org.hamcrest.Matcher<? super java.lang.Integer> precisionMatcher)
BigDecimal whose precision satisfies
the matcher provided as an argument. Notice that the precision reflects possible trailing zeros.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasNormalizedPrecision(org.hamcrest.Matcher<? super java.lang.Integer> precisionMatcher)
BigDecimal whose normalized precision
(i.e. after trailing zeros stripped) satisfies
the matcher provided as an argument.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasPrecision(int expectedPrecision)
BigDecimal whose precision is equal
to the argument. Notice that the precision reflects possible trailing zeros.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasNormalizedPrecision(int expectedPrecision)
BigDecimal whose normalized precision
(i.e. after trailing zeros stripped) equals to the argument.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasRoundedValue(int scale,
java.math.RoundingMode roundingMode,
org.hamcrest.Matcher<? super java.math.BigDecimal> matcher)
BigDecimal that, when rounded to the
given scale using the specified rounding mode, satisfies the provided matcher.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasRoundedValue(int scale,
java.math.RoundingMode roundingMode,
java.math.BigDecimal expectedValue)
BigDecimal that, when rounded to the
given scale using the specified rounding mode, numerically equals to the provided value.hasValue(BigDecimal)public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasRoundedValue(java.math.RoundingMode roundingMode,
org.hamcrest.Matcher<? super java.math.BigDecimal> matcher)
BigDecimal that, when rounded to the
scale 0 using the specified rounding mode, satisfies the provided matcher.public static <T> org.hamcrest.Matcher<java.math.BigDecimal> hasRoundedValue(java.math.RoundingMode roundingMode,
java.math.BigDecimal expectedValue)
BigDecimal that, when rounded to the
scale 0 using the specified rounding mode, numerically equals to the provided value.hasValue(BigDecimal)