fold<R> method
Folds both branches into a single value.
Implementation
R fold<R>(R Function(UseCaseException exception) onFailure, R Function(T value) onSuccess) => switch (this) {
UseCaseSuccess(:final value) => onSuccess(value),
UseCaseFailure(:final value) => onFailure(value),
};