Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Optional.ofNullable(order.getCurrency()).orElse("USD");
- Optional.ofNullable(params.get("abc")).orElseThrow(() -> new IllegalArgumentException(message));
- public interface User {
- String name();
- Integer age();
- User EMPTY = new User() {
- @Override
- public String name() {
- return "";
- }
- @Override
- public Integer age() {
- return 0;
- }
- };
- }
- Optional.ofNullable(user).orElse(User.EMPTY)
Add Comment
Please, Sign In to add comment