public class OptionalOrUndefined {
@Getter private final boolean defined;
private final T value;
public static OptionalOrUndefined optionalOfNullable(T value) {
return new OptionalOrUndefined(true, value);
}
public static OptionalOrUndefined undefined() {
return new OptionalOrUndefined(false, null);
}
public static OptionalOrUndefined undefinedIfNull(OptionalOrUndefined property) {
return property != null ? property : OptionalOrUndefined.undefined();
}
public OptionalOrUndefined map(Function
Подробнее здесь: [url]https://stackoverflow.com/questions/78799384/spring-boot-json-merge-patch-map-properties-to-custom-type-field[/url]