/** * Constructor for successful outcome of an operation * @param result * the return value of the operation */ public static <RESULTTYPE> ExecutionResult<RESULTTYPE> ofSuccess(RESULTTYPE result) { return new ExecutionResult<>(result, null); }
/** * Constructor for exceptional outcome of an operation * @param exception * the caught exception */ public static <RESULTTYPE> ExecutionResult<RESULTTYPE> ofException(Exception exception) { return new ExecutionResult<>(null, exception); }