DecodingResult
A discriminated union that encapsulates a successful outcome with a value of type T or a failure with an arbitrary Throwable exception. A schema mismatch is a special type of failure that may be partially recoverable.
Since
0.4.0
Properties
Returns true
if this instance represents a schema mismatch. In this case isSuccess returns false
.
Functions
Returns the result of onSuccess for the encapsulated value if this instance represents success or the result of onFailure for the encapsulated Throwable if this instance represents failure.
Returns the result of onSuccess for the encapsulated value if this instance represents success, the result of onSchemaMismatch for the encapsulated JsonElement and Throwable if this instance represents a schema mismatch, or the result of onFailure for the encapsulated Throwable if this instance represents any other failure.
Returns the encapsulated value if this instance represents success or the defaultValue if it is failure.
Returns the encapsulated value if this instance represents success or the result of onFailure for the encapsulated Throwable exception if it is failure.
Returns the encapsulated value if this instance represents success, the result of onSchemaMismatch for the encapsulated JsonElement and Throwable if it is schema mismatch or the result of onFailure for the encapsulated Throwable if it is failure.
Tries to recover the response partially if the result represents a schema mismatch. If the result represents another failure, an IllegalStateException is thrown. Successful results are simply transformed.