Tag

Unit Conversion

0 views collected around this technical thread.

Architect's Guide
Architect's Guide
Jan 25, 2024 · Backend Development

Automatic Unit Conversion in Java Using Maps and Custom Annotations

This article explains how to automate unit conversions for Java DTOs by first using a Map to mark fields and an enum for conversion types, then enhancing the solution with a custom annotation and reflection to make the process more reusable and maintainable.

AnnotationsBackendJava
0 likes · 10 min read
Automatic Unit Conversion in Java Using Maps and Custom Annotations
Architecture Digest
Architecture Digest
Jan 4, 2024 · Backend Development

Automatic Unit Conversion in Java Using Reflection and Custom Annotations

This article explains how to automate repetitive unit‑conversion tasks in Java backend code by first using a map‑based reflection utility and then enhancing it with a custom annotation to declaratively specify conversion types for DTO fields.

AnnotationsBackendJava
0 likes · 8 min read
Automatic Unit Conversion in Java Using Reflection and Custom Annotations
IT Xianyu
IT Xianyu
Apr 27, 2023 · Backend Development

Automatic Unit Conversion in Java Using Reflection and Custom Annotations

This article demonstrates how to automatically convert monetary, percentage, permillage and other numeric fields in Java DTOs by marking target properties with a map or a custom annotation, then applying reflection‑based logic to perform scaling, rounding and unit changes in a reusable utility class.

AnnotationsBackendJava
0 likes · 10 min read
Automatic Unit Conversion in Java Using Reflection and Custom Annotations