Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
最近我开始阅读有关 Javaslang 及其对 Java 8 添加的类的改进。深入研究文档时,我遇到了以下方法:
Option.nothing()
它返回一个单例类型的实例Option<Void>。但是,我想不出一个可以派上用场的用例(也许是为了表明它是链条的末端,但我仍然可以这样做.map(v -> 1))。是否有一个用例可以方便且更可取None?
Option<Void>
.map(v -> 1)
None