Merge branch 'master' of https://github.com/dev-chirag/tutorials
This commit is contained in:
commit
af18209504
|
@ -8,11 +8,7 @@ public class UsingOptional {
|
|||
|
||||
String response = doSomething(processed);
|
||||
|
||||
if (response == null) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
return Optional.of(response);
|
||||
return Optional.ofNullable(response);
|
||||
}
|
||||
|
||||
private String doSomething(boolean processed) {
|
||||
|
|
Loading…
Reference in New Issue