Class BigDecimalSubject


  • public final class BigDecimalSubject
    extends ComparableSubject<java.math.BigDecimal>
    Propositions for BigDecimal typed subjects.
    Author:
    Kurt Alfred Kluever
    • Method Detail

      • isEqualToIgnoringScale

        public void isEqualToIgnoringScale​(java.math.BigDecimal expected)
        Fails if the subject's value is not equal to the value of the given BigDecimal. (i.e., fails if actual.comparesTo(expected) != 0).

        Note: The scale of the BigDecimal is ignored. If you want to compare the values and the scales, use isEqualTo(Object).

      • isEqualToIgnoringScale

        public void isEqualToIgnoringScale​(java.lang.String expected)
        Fails if the subject's value is not equal to the value of the BigDecimal created from the expected string (i.e., fails if actual.comparesTo(new BigDecimal(expected)) != 0).

        Note: The scale of the BigDecimal is ignored. If you want to compare the values and the scales, use isEqualTo(Object).

      • isEqualToIgnoringScale

        public void isEqualToIgnoringScale​(long expected)
        Fails if the subject's value is not equal to the value of the BigDecimal created from the expected long (i.e., fails if actual.comparesTo(new BigDecimal(expected)) != 0).

        Note: The scale of the BigDecimal is ignored. If you want to compare the values and the scales, use isEqualTo(Object).

      • isEqualTo

        public void isEqualTo​(@Nullable java.lang.Object expected)
        Fails if the subject's value and scale is not equal to the given BigDecimal.

        Note: If you only want to compare the values of the BigDecimals and not their scales, use isEqualToIgnoringScale(BigDecimal) instead.

        Overrides:
        isEqualTo in class Subject
      • isEquivalentAccordingToCompareTo

        public void isEquivalentAccordingToCompareTo​(@Nullable java.math.BigDecimal expected)
        Fails if the subject is not equivalent to the given value according to Comparable.compareTo(T), (i.e., fails if a.comparesTo(b) != 0). This method behaves identically to (the more clearly named) isEqualToIgnoringScale(BigDecimal).

        Note: Do not use this method for checking object equality. Instead, use isEqualTo(Object).

        Overrides:
        isEquivalentAccordingToCompareTo in class ComparableSubject<java.math.BigDecimal>