Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.7</version>
<version>3.5.12</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand Down Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
<version>4.8.181</version>
<version>4.8.184</version>
</dependency>


Expand All @@ -61,7 +61,7 @@
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.10.0</version>
<version>1.10.1</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
Expand All @@ -78,7 +78,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.8.14</version>
<version>2.8.16</version>
</dependency>

<!-- Testing -->
Expand Down Expand Up @@ -115,7 +115,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>2.0.2</version>
<version>2.0.4</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -137,13 +137,13 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-junit-jupiter</artifactId>
<version>2.0.2</version>
<version>2.0.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-postgresql</artifactId>
<version>2.0.2</version>
<version>2.0.4</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -153,7 +153,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<version>3.15.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand Down Expand Up @@ -195,12 +195,12 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>11.1.0</version>
<version>13.3.0</version>
</dependency>
<dependency>
<groupId>it.aboutbits</groupId>
<artifactId>java-checkstyle-config</artifactId>
<version>1.0.1</version>
<version>1.1.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down