- Add
.getOrElse(T value),.getOrElseThrow(Supplier<X extends Throwable> supplier), and.toOptional()toResult<T>(thanks, hamishwilson!)
- Add
.getLeftOrElseThrow(Function<R, Exception>)and.getRightOrElseThrow(Function<L, Exception>)(thanks, jartysiewicz!)
- Add
EitherCollectorswith.toLeftBiased()and.toRightBiased()(thanks, peterunold!)
- Add
getLeftOrElseThrowandgetRightOrElseThrowto Either (thanks, michaldo!)
- Add
ifOkandruntoResult - Add javadocs to
Result
- Add
flatMapto Either - Add javadocs to Either
- Refactor some tests
- Drop gradle, switch to maven for builds. Gradle is a hassle.
- Add
mapLeft,mapRight,flatMapLeft, andflatMapRighttoEither(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
mapfunction where it didn't useattemptto "wrap" exceptions.
- Fixed type signature of Result's
flatMapfunction (should be accept anA -> Result<B>and return aResult<B>)
- Removed duplication (
Lefts don't need therightValuefield, and vice-versa)
- Add
.run(leftConsumer, rightConsumer)to allow "terminal" operations on an Either.