Releases: lambdista/try
Handle NPE within a Failure
Handle NullPointerException
within a Failure
where possible. For example if a client passes null
to the map
method instead of a valid Function
then the result will be a Failure
and no NPE is thrown. This is because the result of map
is of type Try
too. However if one passes null
to forEach
, whose result type is void
, the only reasonable solution in this case is to fail with a NullPointerException
AutoCloseable and Throwable
Add AutoCloseable
handling. Plus now the library traps all Throwable
types but keeps not handling Error
types by relaunching them. Thanks to @gtrefs for his contribution.
Add TryBinaryOperator
A BinaryOperator
helper which simplifies working with binary operators over Try
values, e.g. when reducing a Stream
of Try
values. Thanks to @oxc for his contribution.
First published version
Note that its version starts with 0 so anything may change at any time. The public API should not be considered stable. In this sense I'll strive to follow SemVer for versioning.