Is there an equivalent of Scala's Either in Java 8?

后端 未结 8 778
南旧
南旧 2020-11-28 23:00

Just like java.util.Optional in Java 8 is (somewhat) equivalent to Scala\'s Option[T] type, is there an equivalent to Scala\'s Eithe

8条回答
  •  再見小時候
    2020-11-28 23:52

    There is no Either in the Java Standard Library. However there is an implementation of Either in FunctionalJava, along with many other nice classes.

提交回复
热议问题