if (value != null) { doSomething(value); }
Optional maybeValue = Optional.ofNullable(value); if (maybeValue.isPresent()) { doSomething(maybeValue.get()); }
No comments:
Post a Comment