Interface ServiceResult<T>
public interface ServiceResult<T>
This interface defines a service result in Zephyr Scale 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.int
Returns the status code that was returned by the service, or null.Returns theValidationResult
instance if the result is not valid.boolean
isValid()
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 theValidationResult
instance if the result is not valid.- Returns:
- the
ValidationResult
instance 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
-