java.lang.Object
page.codeberg.friedolyn.util.Result<Type>
- Type Parameters:
Type
- The class of the operation'sresult
.
Represents the outcome of an operation that is either
successful or unsuccessful
and may return an
elaborate result
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
SUCCESS
private final boolean SUCCESSWhether the operation was successful. Success does not imply that an elaborateresult
was returned, and failure does not imply that no elaborate result was returned. -
RESULT
The detailed outcome of the operation. Its presence does not imply that the operation was successful, and its absence does not imply that the operation was unsuccessful.
-
-
Constructor Details
-
Result
public Result(boolean success) Creates a new result object with no elaborate return value. UseResult(boolean, Type)
if there is an elaborate return value that should be included.- Parameters:
success
- True if the operation was successful, false otherwise.- See Also:
-
Result
Creates a new result object.- Parameters:
success
- True if the operation was successful, false otherwise.result
- The elaborate return value of the operation. Must not be null. UseResult(boolean)
if there is no elaborate return value.- See Also:
-
-
Method Details
-
getSuccess
public boolean getSuccess()- Returns:
- Whether the operation was successful. If true, this does not imply that
getResult()
will return a non-empty value. If false, this does not imply thatgetResult()
will return an empty value.
-
getResult
-