Feature
Currently using the @ToString annotation on a record results in a error: @ToString is only supported on a class or enum. error. While the record itself generates toString implementation by default, it includes all of it's fields. In cases when such records can include sensitive medical or financial information this behaviour is unacceptable and there is a need to include only a few explicitly included record fields to prevent accidental logging of such information. Having to resort to overriding toString each time is not optimal.
Before the feature:
@Value
@ToString(onlyExplicitlyIncluded = true)
public class PDFObservation {
@ToString.Include
String code;
String resultValue;
String resultUnit;
}
After the feature:
@ToString(onlyExplicitlyIncluded = true)
public record Observation(@ToString.Include String code, String resultValue, String resultUnit) {}
Target audiance
Developers working with systems containing sensitive medical or financial information.
Feature Currently using the
@ToString
annotation on a record results in aerror: @ToString is only supported on a class or enum.
error. While the record itself generatestoString
implementation by default, it includes all of it's fields. In cases when such records can include sensitive medical or financial information this behaviour is unacceptable and there is a need to include only a few explicitly included record fields to prevent accidental logging of such information. Having to resort to overridingtoString
each time is not optimal.Before the feature:
After the feature:
Target audiance Developers working with systems containing sensitive medical or financial information.