Releases: 2bllw8/either
Releases · 2bllw8/either
v3.4.0
- Documentation improvement
- Added
LeftProjection#contains
- Added
Either#from
- Removed
CheckedException
(deprecated since 3.2.0)- Migration:
- Try.from(() -> { - try { - return Files.delete(f); - } catch (IOException e) { - throw new CheckedException(e); - } - }) + Try.from(() -> Files.delete(f))
Full Changelog: 3.3.0...3.4.0
v3.3.0
- Add
Try#stream
to convert aSuccess
to aStream
containing the held value or aFailure
to an emptyStream
- Add
CheckedFunction
, to be used withTry#map
to allow any exception thrown during the execution of the given function to be properly caught and the return value made aFailure
rather than aSuccess
Full Changelog: 3.2.0...3.3.0
v3.2.0
- Documentation improvement
- Add
CheckedSupplier
to be used for theTry#from
method. It is no longer needed to wrap checked exceptions as they'll be handled by theTry
class implementation.- Migration example:
- Try.from(() -> {
- try {
- return Files.delete(f);
- } catch (IOException e) {
- throw new CheckedException(e);
- }
- })
+ Try.from(() -> Files.delete(f))
Full Changelog: 3.1.0...3.2.0
v3.1.0
- Remove methods that were deprecated in older versions
- Add
Try#forEach(Consumer, Consumer)
- Minor implementation improvement
Full Changelog: 3.0.0...3.1.0
v3.0.0
- Add the
Try
type based on the Scala 3Try
type- Replaces
Either<A extends Throwable, B>#tryCatch(Supplier<B>, Class<A>)
andEither<A, B>#tryCatch(Supplier<B>, Function<Throwable, A>>)
which are now deprecated - The
Try
type represents a computation that may either result in an exception, or return a successfully computed value. It's similar to, but semantically different from theEither
type.
- Replaces
- Improve implementation details of the
Either
type, with no public API changes
Full Changelog: 2.2.0...3.0.0
v2.2.0
- Deprecate
Either<A extends Exception, B>#fromTry(Supplier<B>, Class<A>)
- Replaced by
Either<A extends Throwable, B>#tryCatch(Supplier<B>, Class<A>)
- Adds support for catching checked exceptions by throwing a wrapper exception
CheckedException
(see the javadoc for more information)
- Adds support for catching checked exceptions by throwing a wrapper exception
- Replaced by
- Add
Either<A, B>#tryCatch(Supplier<B>, Function<Throwable, A>>)
Full Changelog: 2.1.0...2.2.0
v2.1.0
v2.0.0
Re-implement the library using the Scala 3 Either type as reference.
This version is not backwards–compatible with 1.y.z versions!
Check out the API documentation to see all the new functionality!