object MapsUtil
- Alphabetic
- By Inheritance
- MapsUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def extendMapWith[K, V](m: Map[K, V], extendWith: IterableOnce[(K, V)])(merge: (V, V) => V): Unit
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def groupByMultipleM[M[_], K, K2, V](m: Map[K, V])(f: (K) => M[Set[K2]])(implicit M: Monad[M]): M[Map[K2, Set[V]]]
- m
An input map
- f
A function to map each of the input keys to a new set of keys ks Generates a new map m' with the following property: If { (k,v) in m and k' in f(k) } then v is in the set m'[k'] See
MapsUtilTest
for an example.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mapDiff[K, V](minuend: Map[K, V], subtrahend: Map[K, V])(implicit loggingContext: ErrorLoggingContext): Map[K, V]
Return all key-value pairs in minuend that are different / missing in subtrahend
Return all key-value pairs in minuend that are different / missing in subtrahend
- Exceptions thrown
java.lang.IllegalArgumentException
if the minuend is not defined for all keys of the subtrahend.
- def mergeMapsOfSets[K, V](big: Map[K, Set[V]], small: Map[K, Set[V]]): Map[K, Set[V]]
Merges two maps where the values are sets of V
Merges two maps where the values are sets of V
- big
the likely larger of the two maps (so we can merge the small into the big, rather than the other way around)
- small
the likely smaller of the maps.
- def mergeWith[K, V](map1: Map[K, V], map2: Map[K, V])(f: (V, V) => V): Map[K, V]
- def modifyWithConcurrentlyChecked_[A, N, K, V](map: Map[K, V], key: K, notFound: => Checked[A, N, Option[V]], f: (V) => Checked[A, N, Option[V]]): Checked[A, N, Unit]
Specializes updateWithConcurrentlyM_ to the Checked monad, where the non-aborts are only kept from the invocation of
notFound
orf
that causes the first Checked.Abort or updates the map. - def modifyWithConcurrentlyM[F[_], K, V](map: Map[K, V], key: K, notFound: => F[Option[V]], f: (V) => F[Option[V]])(implicit monad: FlatMap[F]): F[Option[V]]
Atomically modifies the given map at the given key.
Atomically modifies the given map at the given key.
notFound
may be evaluated even if the key is present at the atomic update; in this case, its monadic effect propagates to the result.f
may be evaluated several times on several of the previous values associated to the key, even if no value is associated with the key immediately before the atomic update happens. The monadic effect of all these evaluations propagates to the result.- map
The map that is updated
- notFound
The value to be used if the key was not present in the map. scala.None$ denotes that the map should not be modified.
- f
The function used to transform the value found in the map. If the returned value is scala.None$, the key is removed from the map.
- returns
The value associated with the key before the update.
- def modifyWithConcurrentlyM_[F[_], K, V](map: Map[K, V], key: K, notFound: => F[Option[V]], f: (V) => F[Option[V]])(implicit monad: FlatMap[F]): F[Unit]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def putAndCheckExisting[K, V](map: Map[K, V], key: K, value: V)(implicit loggingContext: ErrorLoggingContext): Future[Unit]
Insert the pair (key, value) to
map
if not already present.Insert the pair (key, value) to
map
if not already present. Assert that any existing element forkey
is equal tovalue
. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def updateWithConcurrently[K, V <: AnyRef](map: Map[K, V], key: K)(f: (V) => V): Boolean
Updates the key of the current map if present.
Updates the key of the current map if present. The update function
f
may be evaluated multiple times. iff
throws an exception, the exception propagates and the map is not updated.- returns
Whether the map changed due to this update
- def updateWithConcurrentlyChecked_[A, N, K, V](map: Map[K, V], key: K, notFound: => Checked[A, N, V], f: (V) => Checked[A, N, V]): Checked[A, N, Unit]
- def updateWithConcurrentlyM[F[_], K, V](map: Map[K, V], key: K, notFound: => F[V], f: (V) => F[V])(implicit monad: FlatMap[F]): F[Option[V]]
Atomically updates the given map at the given key.
Atomically updates the given map at the given key. In comparison to modifyWithConcurrentlyM, this method supports only inserting and updating elements. It does not support removing elements or preventing the insertion of elements when they are not originally in the map.
- def updateWithConcurrentlyM_[F[_], K, V](map: Map[K, V], key: K, notFound: => F[V], f: (V) => F[V])(implicit monad: FlatMap[F]): F[Unit]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])