diff --git a/pom.xml b/pom.xml index 5557f4f..c03910d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 3.5.7 + 3.5.12 @@ -52,7 +52,7 @@ io.github.classgraph classgraph - 4.8.181 + 4.8.184 @@ -61,7 +61,7 @@ commons-validator commons-validator - 1.10.0 + 1.10.1 commons-collections @@ -78,7 +78,7 @@ org.springdoc springdoc-openapi-starter-webmvc-ui - 2.8.14 + 2.8.16 @@ -115,7 +115,7 @@ org.testcontainers testcontainers - 2.0.2 + 2.0.4 test @@ -137,13 +137,13 @@ org.testcontainers testcontainers-junit-jupiter - 2.0.2 + 2.0.4 test org.testcontainers testcontainers-postgresql - 2.0.2 + 2.0.4 test @@ -153,7 +153,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.1 + 3.15.0 ${java.version} ${java.version} @@ -195,12 +195,12 @@ com.puppycrawl.tools checkstyle - 11.1.0 + 13.3.0 it.aboutbits java-checkstyle-config - 1.0.1 + 1.1.0 diff --git a/src/main/java/it/aboutbits/springboot/toolbox/type/ScaledBigDecimal.java b/src/main/java/it/aboutbits/springboot/toolbox/type/ScaledBigDecimal.java index 8738efe..ef44bb1 100644 --- a/src/main/java/it/aboutbits/springboot/toolbox/type/ScaledBigDecimal.java +++ b/src/main/java/it/aboutbits/springboot/toolbox/type/ScaledBigDecimal.java @@ -1,5 +1,6 @@ package it.aboutbits.springboot.toolbox.type; +import com.fasterxml.jackson.annotation.JsonIgnore; import org.jspecify.annotations.NullMarked; import java.math.BigDecimal; @@ -275,42 +276,52 @@ public short shortValue() { return (short) intValue(); } + @JsonIgnore public boolean isZero() { return this.value().compareTo(BigDecimal.ZERO) == 0; } + @JsonIgnore public boolean isNegative() { return this.value().compareTo(BigDecimal.ZERO) < 0; } + @JsonIgnore public boolean isPositive() { return this.value().compareTo(BigDecimal.ZERO) > 0; } + @JsonIgnore public boolean isPositiveOrZero() { return this.value().compareTo(BigDecimal.ZERO) >= 0; } + @JsonIgnore public boolean isNegativeOrZero() { return this.value().compareTo(BigDecimal.ZERO) <= 0; } + @JsonIgnore public boolean isEqual(ScaledBigDecimal other) { return this.compareTo(other) == 0; } + @JsonIgnore public boolean isBiggerThan(ScaledBigDecimal other) { return this.compareTo(other) > 0; } + @JsonIgnore public boolean isEqualOrBiggerThan(ScaledBigDecimal other) { return this.compareTo(other) >= 0; } + @JsonIgnore public boolean isSmallerThan(ScaledBigDecimal other) { return this.compareTo(other) < 0; } + @JsonIgnore public boolean isEqualOrSmallerThan(ScaledBigDecimal other) { return this.compareTo(other) <= 0; }