mapDataResult

fun <T> mapDataResult(result: DataResult<T>, fallback: T): ValidationResult<T>

Converts a DataResult into a ValidationResult

Return

a non-null validation result with the parsed or fallback value and error message as appropriate

Author

fzzyhmstrs

Since

0.6.5

Parameters

T

the data type

result

DataResult the parsed data result from a Codec or other data source.

fallback

T the value to pass in case data parsing has failed


fun <T> mapDataResult(result: DataResult<T>): ValidationResult<T?>

Converts a DataResult into a ValidationResult with no fallback

Return

a nullable-result validation result with the parsed value or null and error message as appropriate

Author

fzzyhmstrs

Since

0.6.5

Parameters

T

the data type

result

DataResult the parsed data result from a Codec or other data source.