Interface Try<T>

Type Parameters:
T - type of the computed result in the successful case
All Known Implementing Classes:
Try.Failure, Try.Success

public sealed interface Try<T> permits Try.Success<T>, Try.Failure<T>
Functional programming strives to minimize side effects, so throwing exceptions is avoided. Instead, if an operation can fail, it should return a representation of its outcome including an indication of success or failure, as well as its result (if successful), or some error data otherwise. In other words, errors in functional programming are just payload.

Try should be preferred in functional programming approaches in particular in the context of stream pipelines.