We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I have some class with final optional variables, e.g
public final class ProductData { private final String code; private final String category; private final Optional<PriceData> price; //... getters ... }
I want a option to create builder method that takes a PriceData instance and sets price to:
PriceData
price
public ProductDataBuilder withPrice(PriceData price){ this.price = Optional.ofNullable(price); return this; }
This will make building classes with optional variables much smoother as we do not need to pre-wrap the arguments.
The text was updated successfully, but these errors were encountered:
@adnang Optional type for a field is not recommended;
Sorry, something went wrong.
No branches or pull requests
If I have some class with final optional variables, e.g
I want a option to create builder method that takes a
PriceData
instance and setsprice
to:This will make building classes with optional variables much smoother as we do not need to pre-wrap the arguments.
The text was updated successfully, but these errors were encountered: