MapOfResults<K, V extends Object> extension

on

Properties

okValues Map<K, V>

Available on Map<K, Result<V>>, provided by the MapOfResults extension

Returns a new map containing only the unwrapped values from Ok entries.
no setter

Methods

partition() MapResultPartition<K, V>

Available on Map<K, Result<V>>, provided by the MapOfResults extension

Partitions the map into a record containing two maps: one for Ok values and one for Err values.
sequence() Result<Map<K, V>>

Available on Map<K, Result<V>>, provided by the MapOfResults extension

Turns a Map<K, Result<V>> into a Result<Map<K, V>>. If all values are Ok, it returns an Ok<Map<K, V>>. If any value is an Err, it returns the first Err encountered.
whereErr() Map<K, Err<V>>

Available on Map<K, Result<V>>, provided by the MapOfResults extension

Creates a new map containing only the entries where the value is an Err. The values in the new map are instances of Err<V>.
whereOk() Map<K, Ok<V>>

Available on Map<K, Result<V>>, provided by the MapOfResults extension

Creates a new map containing only the entries where the value is an Ok. The values in the new map are instances of Ok<V>.