Skip to content

Commit 6f27dad

Browse files
authored
Fix ScaledBigDecimal deserialization issue and update dependencies (v1) (#59)
* fix Jackson trying to deserialize the new ScaledBigDecimal is\w+ methods * update dependencies
1 parent af763a2 commit 6f27dad

2 files changed

Lines changed: 21 additions & 10 deletions

File tree

pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.5.7</version>
8+
<version>3.5.12</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111

@@ -52,7 +52,7 @@
5252
<dependency>
5353
<groupId>io.github.classgraph</groupId>
5454
<artifactId>classgraph</artifactId>
55-
<version>4.8.181</version>
55+
<version>4.8.184</version>
5656
</dependency>
5757

5858

@@ -61,7 +61,7 @@
6161
<dependency>
6262
<groupId>commons-validator</groupId>
6363
<artifactId>commons-validator</artifactId>
64-
<version>1.10.0</version>
64+
<version>1.10.1</version>
6565
<exclusions>
6666
<exclusion>
6767
<groupId>commons-collections</groupId>
@@ -78,7 +78,7 @@
7878
<dependency>
7979
<groupId>org.springdoc</groupId>
8080
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
81-
<version>2.8.14</version>
81+
<version>2.8.16</version>
8282
</dependency>
8383

8484
<!-- Testing -->
@@ -115,7 +115,7 @@
115115
<dependency>
116116
<groupId>org.testcontainers</groupId>
117117
<artifactId>testcontainers</artifactId>
118-
<version>2.0.2</version>
118+
<version>2.0.4</version>
119119
<scope>test</scope>
120120
<exclusions>
121121
<exclusion>
@@ -137,13 +137,13 @@
137137
<dependency>
138138
<groupId>org.testcontainers</groupId>
139139
<artifactId>testcontainers-junit-jupiter</artifactId>
140-
<version>2.0.2</version>
140+
<version>2.0.4</version>
141141
<scope>test</scope>
142142
</dependency>
143143
<dependency>
144144
<groupId>org.testcontainers</groupId>
145145
<artifactId>testcontainers-postgresql</artifactId>
146-
<version>2.0.2</version>
146+
<version>2.0.4</version>
147147
<scope>test</scope>
148148
</dependency>
149149
</dependencies>
@@ -153,7 +153,7 @@
153153
<plugin>
154154
<groupId>org.apache.maven.plugins</groupId>
155155
<artifactId>maven-compiler-plugin</artifactId>
156-
<version>3.14.1</version>
156+
<version>3.15.0</version>
157157
<configuration>
158158
<source>${java.version}</source>
159159
<target>${java.version}</target>
@@ -195,12 +195,12 @@
195195
<dependency>
196196
<groupId>com.puppycrawl.tools</groupId>
197197
<artifactId>checkstyle</artifactId>
198-
<version>11.1.0</version>
198+
<version>13.3.0</version>
199199
</dependency>
200200
<dependency>
201201
<groupId>it.aboutbits</groupId>
202202
<artifactId>java-checkstyle-config</artifactId>
203-
<version>1.0.1</version>
203+
<version>1.1.0</version>
204204
</dependency>
205205
</dependencies>
206206
</plugin>

src/main/java/it/aboutbits/springboot/toolbox/type/ScaledBigDecimal.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package it.aboutbits.springboot.toolbox.type;
22

3+
import com.fasterxml.jackson.annotation.JsonIgnore;
34
import org.jspecify.annotations.NullMarked;
45

56
import java.math.BigDecimal;
@@ -275,42 +276,52 @@ public short shortValue() {
275276
return (short) intValue();
276277
}
277278

279+
@JsonIgnore
278280
public boolean isZero() {
279281
return this.value().compareTo(BigDecimal.ZERO) == 0;
280282
}
281283

284+
@JsonIgnore
282285
public boolean isNegative() {
283286
return this.value().compareTo(BigDecimal.ZERO) < 0;
284287
}
285288

289+
@JsonIgnore
286290
public boolean isPositive() {
287291
return this.value().compareTo(BigDecimal.ZERO) > 0;
288292
}
289293

294+
@JsonIgnore
290295
public boolean isPositiveOrZero() {
291296
return this.value().compareTo(BigDecimal.ZERO) >= 0;
292297
}
293298

299+
@JsonIgnore
294300
public boolean isNegativeOrZero() {
295301
return this.value().compareTo(BigDecimal.ZERO) <= 0;
296302
}
297303

304+
@JsonIgnore
298305
public boolean isEqual(ScaledBigDecimal other) {
299306
return this.compareTo(other) == 0;
300307
}
301308

309+
@JsonIgnore
302310
public boolean isBiggerThan(ScaledBigDecimal other) {
303311
return this.compareTo(other) > 0;
304312
}
305313

314+
@JsonIgnore
306315
public boolean isEqualOrBiggerThan(ScaledBigDecimal other) {
307316
return this.compareTo(other) >= 0;
308317
}
309318

319+
@JsonIgnore
310320
public boolean isSmallerThan(ScaledBigDecimal other) {
311321
return this.compareTo(other) < 0;
312322
}
313323

324+
@JsonIgnore
314325
public boolean isEqualOrSmallerThan(ScaledBigDecimal other) {
315326
return this.compareTo(other) <= 0;
316327
}

0 commit comments

Comments
 (0)