Skip to content

riomunas/java-optional

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

java-optional

What and how to use optional

source : https://www.youtube.com/watch?v=uEe1S21vSus

orElse : return the value if option is present otherwise returns other

ifPresent : Executed only if optional has a value

ifPresentOrElse : if value is present, performs the given action with the value, otherwise performs the given empty-base action

avoid using option in:

  • method parameter
  • class properties

avoid using 3 method:

  • isPresent
  • isEmpty
  • get

About

What and how to use optional

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages