- Add
.getOrElse(Supplier<T> valueSupplier)
toResult<T>
(thanks, hamishlawson!)
- Add
.getOrElse(T value)
,.getOrElseThrow(Supplier<X extends Throwable> supplier)
, and.toOptional()
toResult<T>
(thanks, hamishlawson!)
- Add
.getLeftOrElseThrow(Function<R, Exception>)
and.getRightOrElseThrow(Function<L, Exception>)
(thanks, jartysiewicz!)
- Add
EitherCollectors
with.toLeftBiased()
and.toRightBiased()
(thanks, peterunold!)
- Add
getLeftOrElseThrow
andgetRightOrElseThrow
to Either (thanks, michaldo!)
- Add
ifOk
andrun
toResult
- Add javadocs to
Result
- Add
flatMap
to Either - Add javadocs to Either
- Refactor some tests
- Drop gradle, switch to maven for builds. Gradle is a hassle.
- Add
mapLeft
,mapRight
,flatMapLeft
, andflatMapRight
toEither
(thanks, michaldo!)
- Upgrade tests to use JUnit 5
- Include gradle wrapper for more-deterministic builds in CI
- Ensure CI pipeline builds on jdk8 and jdk11
- Merge @sfesenko's fix to Result's
map
function where it didn't useattempt
to "wrap" exceptions.
- Fixed type signature of Result's
flatMap
function (should be accept anA -> Result<B>
and return aResult<B>
)
- Removed duplication (
Left
s don't need therightValue
field, and vice-versa)
- Add
.run(leftConsumer, rightConsumer)
to allow "terminal" operations on an Either.