ConcurrentMap

zio.concurrent.ConcurrentMap
See theConcurrentMap companion object
final class ConcurrentMap[K, V] extends AnyVal

Wrapper over java.util.concurrent.ConcurrentHashMap.

Attributes

Companion
object
Source
ConcurrentMap.scala
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def clear: UIO[Unit]

Removes all elements.

Removes all elements.

Attributes

Source
ConcurrentMap.scala
def collectFirst[B](pf: PartialFunction[(K, V), B]): UIO[Option[B]]

Finds the first element of a map for which the partial function is defined and applies the function to it.

Finds the first element of a map for which the partial function is defined and applies the function to it.

Attributes

Source
ConcurrentMap.scala
def compute(key: K, remap: (K, Option[V]) => Option[V]): UIO[Option[V]]

Attempts to compute a mapping for the specified key and its current mapped value (or None if there is no current mapping).

Attempts to compute a mapping for the specified key and its current mapped value (or None if there is no current mapping).

Attributes

Source
ConcurrentMap.scala
def computeIfAbsent(key: K, map: K => V): UIO[V]

Computes a value of a non-existing key.

Computes a value of a non-existing key.

Attributes

Source
ConcurrentMap.scala
def computeIfPresent(key: K, remap: (K, V) => V): UIO[Option[V]]

Attempts to compute a new mapping of an existing key.

Attempts to compute a new mapping of an existing key.

Attributes

Source
ConcurrentMap.scala
def exists(p: (K, V) => Boolean): UIO[Boolean]

Tests whether a given predicate holds true for at least one element in a map.

Tests whether a given predicate holds true for at least one element in a map.

Attributes

Source
ConcurrentMap.scala
def fold[S](zero: S)(f: (S, (K, V)) => S): UIO[S]

Folds the elements of a map using the given binary operator.

Folds the elements of a map using the given binary operator.

Attributes

Source
ConcurrentMap.scala
def forall(p: (K, V) => Boolean): UIO[Boolean]

Tests whether a predicate is satisfied by all elements of a map.

Tests whether a predicate is satisfied by all elements of a map.

Attributes

Source
ConcurrentMap.scala
def get(key: K): UIO[Option[V]]

Retrieves the value associated with the given key.

Retrieves the value associated with the given key.

Attributes

Source
ConcurrentMap.scala

True if there are no elements in this map.

True if there are no elements in this map.

Attributes

Source
ConcurrentMap.scala
def put(key: K, value: V): UIO[Option[V]]

Adds a new key-value pair and optionally returns previously bound value.

Adds a new key-value pair and optionally returns previously bound value.

Attributes

Source
ConcurrentMap.scala
def putAll(keyValues: (K, V)*): UIO[Unit]

Adds all new key-value pairs

Adds all new key-value pairs

Attributes

Source
ConcurrentMap.scala
def putIfAbsent(key: K, value: V): UIO[Option[V]]

Adds a new key-value pair, unless the key is already bound to some other value.

Adds a new key-value pair, unless the key is already bound to some other value.

Attributes

Source
ConcurrentMap.scala
def remove(key: K): UIO[Option[V]]

Removes the entry for the given key, optionally returning value associated with it.

Removes the entry for the given key, optionally returning value associated with it.

Attributes

Source
ConcurrentMap.scala
def remove(key: K, value: V): UIO[Boolean]

Removes the entry for the given key if it is mapped to a given value.

Removes the entry for the given key if it is mapped to a given value.

Attributes

Source
ConcurrentMap.scala
def removeIf(p: (K, V) => Boolean): UIO[Unit]

Removes all elements which do not satisfy the given predicate.

Removes all elements which do not satisfy the given predicate.

Attributes

Source
ConcurrentMap.scala
def replace(key: K, value: V): UIO[Option[V]]

Replaces the entry for the given key only if it is mapped to some value.

Replaces the entry for the given key only if it is mapped to some value.

Attributes

Source
ConcurrentMap.scala
def replace(key: K, oldValue: V, newValue: V): UIO[Boolean]

Replaces the entry for the given key only if it was previously mapped to a given value.

Replaces the entry for the given key only if it was previously mapped to a given value.

Attributes

Source
ConcurrentMap.scala
def retainIf(p: (K, V) => Boolean): UIO[Unit]

Removes all elements which do not satisfy the given predicate.

Removes all elements which do not satisfy the given predicate.

Attributes

Source
ConcurrentMap.scala
def toChunk: UIO[Chunk[(K, V)]]

Collects all entries into a chunk.

Collects all entries into a chunk.

Attributes

Source
ConcurrentMap.scala
def toList: UIO[List[(K, V)]]

Collects all entries into a list.

Collects all entries into a list.

Attributes

Source
ConcurrentMap.scala