Interface ServiceResult<T>
public interface ServiceResult<T>
This interface defines a service result in Zephyr that can contain a generic result if valid or a
ValidationResult otherwise.-
Method Summary
Modifier and TypeMethodDescriptionReturns a list with error messages if the result is not valid.Returns the value that was returned by the service, or null.intReturns the status code that was returned by the service, or null.Returns theValidationResultinstance if the result is not valid.booleanisValid()Returns true if there are no errors, false otherwise.
-
Method Details
-
getResult
T getResult()Returns the value that was returned by the service, or null.- Returns:
- the value that was returned by the service, or null.
- Since:
- 6.8.0
-
isValid
boolean isValid()Returns true if there are no errors, false otherwise.- Returns:
- true if there are no errors, false otherwise.
- Since:
- 6.8.0
-
getValidationResult
ValidationResult getValidationResult()Returns theValidationResultinstance if the result is not valid.- Returns:
- the
ValidationResultinstance if the result is not valid. - Since:
- 6.8.0
-
getErrorMessages
Returns a list with error messages if the result is not valid.- Returns:
- a list with error messages if the result is not valid.
- Since:
- 6.8.0
-
getStatusCode
int getStatusCode()Returns the status code that was returned by the service, or null.- Returns:
- the value that was returned by the service, or null.
- Since:
- 9.20.0
-