`

google的guava学习 之option

    博客分类:
  • java
阅读更多
Optional.fromNullable(input).or(input2)


这个fromNullable,
当input为null的时候会返回absent (Optional的子类,表示不存在,他的or方法会直接返回input2)
当input不为null的时候会返回Present(Optional的子类,表示存在,他的or方法会直接返回input)
1
4
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics