Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def programOptional(id: Long): Info = {
- val user = optional(getUser)(id)
- val info = optional(getInfo)(user)
- info
- }
- programOptional(123) // res3: Info = Info(Tom)
- programOptional(1234) // res4: Info = null
Add Comment
Please, Sign In to add comment