How can we create add field level annotations for java 17 record class?
record Rectangle(double length, double width) { }
yes we can use field level annotations (annotation with @Target(ElementType.FIELD)
in the defination.
@JsonInclude(Include.NON_NULL)
record Rectangle(
@JsonProperty("lengthAlias") double length,
double width) { }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With