map
Transforms the success value using the given transform function.
If this is a Success, returns a new Success with the transformed value. If this is a Failure, returns the same Failure unchanged.
val stringResult: BleResult<String> = byteArrayResult
.map { bytes -> String(bytes, Charsets.UTF_8) }Content copied to clipboard
Return
A new BleResult with the transformed value, or the original failure.
Parameters
transform
The function to apply to the success value.