Skip navigation links
Lazy Result Library 0.6.0.1

Package com.leakyabstractions.result.lazy

A Java library to handle success and failure without exceptions

See: Description

Package com.leakyabstractions.result.lazy Description

A Java library to handle success and failure without exceptions

Lazy Result Library for Java

Lazy results can be manipulated just like any other result; they will try to defer the invocation of the given supplier as long as possible. The purpose is to encapsulate an expensive operation that may be omitted if there's no actual need to examine the result.

Lazy results can be screened and transformed without actually performing the expensive operation:

On the other hand, the supplier will be invoked if any of these terminal operations is performed on a lazy result:

Finally, conditional actions will be performed immediately unless they are lazy too:

Once a lazy result retrieves the supplied result, all future operations will be performed immediately and the returned Result objects should not be lazy.

Author:
Guillermo Calvo
See Also:
Result, LazyResults
Skip navigation links
Lazy Result Library 0.6.0.1