I'm trying to get immutable Object that sets default value to all null fields. So my object is:
import lombok.Builder;
import lombok.Value;
@Value
@Builder
public class Test {
@Builder.Default
String name = "default";
}
and I expect these two tests to pass:
assert Test.builder().build().name == "default"
assert Test.builder().name(null).build().name == "default"
but second one isn't passing.
How can I tell lombok not to set actually null in such case? I have value that comes from another service and it's nullable. I want to use default value if it came null to me.