Skip to content

Commit 48518c7

Browse files
authored
Fix ScaledBigDecimal deserialization issue and update dependencies (#58)
* fix Jackson trying to deserialize the new ScaledBigDecimal is\w+ methods * update dependencies
1 parent f315fbe commit 48518c7

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

pom.xml

Lines changed: 9 additions & 9 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>4.0.2</version>
8+
<version>4.0.4</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111

@@ -17,9 +17,9 @@
1717

1818
<properties>
1919
<java.version>25</java.version>
20-
<errorprone.version>2.46.0</errorprone.version>
20+
<errorprone.version>2.48.0</errorprone.version>
2121
<jooq.version>3.20.11</jooq.version>
22-
<nullaway.version>0.12.15</nullaway.version>
22+
<nullaway.version>0.13.1</nullaway.version>
2323
</properties>
2424

2525
<dependencyManagement>
@@ -100,7 +100,7 @@
100100
<dependency>
101101
<groupId>org.springdoc</groupId>
102102
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
103-
<version>3.0.0</version>
103+
<version>3.0.2</version>
104104
</dependency>
105105

106106
<!-- Testing -->
@@ -142,19 +142,19 @@
142142
<dependency>
143143
<groupId>org.testcontainers</groupId>
144144
<artifactId>testcontainers</artifactId>
145-
<version>2.0.2</version>
145+
<version>2.0.4</version>
146146
<scope>test</scope>
147147
</dependency>
148148
<dependency>
149149
<groupId>org.testcontainers</groupId>
150150
<artifactId>testcontainers-junit-jupiter</artifactId>
151-
<version>2.0.2</version>
151+
<version>2.0.4</version>
152152
<scope>test</scope>
153153
</dependency>
154154
<dependency>
155155
<groupId>org.testcontainers</groupId>
156156
<artifactId>testcontainers-postgresql</artifactId>
157-
<version>2.0.2</version>
157+
<version>2.0.4</version>
158158
<scope>test</scope>
159159
</dependency>
160160

@@ -184,7 +184,7 @@
184184
<plugin>
185185
<groupId>org.apache.maven.plugins</groupId>
186186
<artifactId>maven-compiler-plugin</artifactId>
187-
<version>3.14.1</version>
187+
<version>3.15.0</version>
188188
<configuration>
189189
<source>${java.version}</source>
190190
<target>${java.version}</target>
@@ -255,7 +255,7 @@
255255
<dependency>
256256
<groupId>com.puppycrawl.tools</groupId>
257257
<artifactId>checkstyle</artifactId>
258-
<version>12.3.0</version>
258+
<version>13.3.0</version>
259259
</dependency>
260260
<dependency>
261261
<groupId>it.aboutbits</groupId>

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)