map

inline fun <VALUE, NEW_VALUE> Result<VALUE>.map(transform: (VALUE) -> NEW_VALUE): Result<NEW_VALUE>

Returns the encapsulated result of the given transform function applied to encapsulated value if this instance represents Success or the original encapsulated exception if it is Error.

Note, that an exception thrown by transform function is rethrown by this function. See mapCatching for an alternative that encapsulates exceptions.