Package net.reevik.shade
Interface Result<T>
- Type Parameters:
T- Actual result type.
- All Known Implementing Classes:
ErrorResult,SuccessResult
public interface Result<T>
A wrapper for the result object from the endpoint call.
-
Method Summary
Modifier and TypeMethodDescriptionduration()Endpoint call duration.Returns the result object if the endpoint call succeeded, or throws an exception if otherwise.booleanIf the call succeeds, returns true.
-
Method Details
-
getOrThrow
Returns the result object if the endpoint call succeeded, or throws an exception if otherwise.- Returns:
- The result object from the endpoint.
- Throws:
Exception- If the call failed.
-
duration
Duration duration()Endpoint call duration.- Returns:
Durationinstance.
-
isSucceeded
boolean isSucceeded()If the call succeeds, returns true.- Returns:
- f the call succeeds, returns true.
-