Interface Result<T extends @UnknownNullability Object>

Type Parameters:
T - the type, can be nullable.
All Known Implementing Classes:
Result.Error, Result.Ok

public sealed interface Result<T extends @UnknownNullability Object> permits Result.Ok<T>, Result.Error<T>
Results are used in Encoder and Decoder to primarily function as a way of passing back exceptions as values.
They have two states Result.Ok and Result.Error, you can use pattern matching to extract the values or use some of the helper methods provided like orElseThrow() or mapResult(Function).
To construct simply just do new Result.Ok<>(value) and new Result.Error<>("Error message!")