object MapOps
Implicits for converting Maps.
import com.twitter.conversions.MapOps._ Map(1 -> "a").mapKeys { _.toString } Map(1 -> "a").invert Map(1 -> "a", 2 -> "b").filterValues { _ == "b" } Map(2 -> "b", 1 -> "a").toSortedMap
- Alphabetic
- By Inheritance
- MapOps
- 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()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def filterNotKeys[K, V](inputMap: Map[K, V], func: (K) => Boolean): Map[K, V]
Filters the pairs in the map which keys do NOT satisfy the predicate represented by
func
.Filters the pairs in the map which keys do NOT satisfy the predicate represented by
func
.- inputMap
the map which will be filtered
- func
the predicate that needs to be satisfied to NOT select a key-value pair
- returns
the filtered map
- def filterNotValues[K, V](inputMap: Map[K, V], func: (V) => Boolean): Map[K, V]
Filters the pairs in the map which values do NOT satisfy the predicate represented by
func
.Filters the pairs in the map which values do NOT satisfy the predicate represented by
func
.- inputMap
the map which will be filtered
- func
the predicate that needs to be satisfied to NOT select a key-value pair
- returns
the filtered map
- def filterValues[K, V](inputMap: Map[K, V], func: (V) => Boolean): Map[K, V]
Filters the pairs in the map which values satisfy the predicate represented by
func
.Filters the pairs in the map which values satisfy the predicate represented by
func
.- inputMap
the map which will be filtered
- func
the predicate that needs to be satisfied to select a key-value pair
- returns
the filtered map
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def invert[K, V](inputMap: Map[K, V]): Map[V, Seq[K]]
Inverts the map so that the input map's values are the distinct keys and the corresponding keys, represented in a sequence, as the values.
Inverts the map so that the input map's values are the distinct keys and the corresponding keys, represented in a sequence, as the values.
- inputMap
the map to invert
- returns
the inverted map
- def invertSingleValue[K, V](inputMap: Map[K, V]): Map[V, K]
Inverts the map so that every input map value becomes the key and the input map key becomes the value.
Inverts the map so that every input map value becomes the key and the input map key becomes the value.
- inputMap
the map to invert
- returns
the inverted map
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mapKeys[K, V, T](inputMap: Map[K, V], func: (K) => T): Map[T, V]
Transforms the keys of the map according to the given
func
.Transforms the keys of the map according to the given
func
.- inputMap
the map to transform the keys
- func
the function literal which will be applied to the keys of the map
- returns
the map with transformed keys and original values
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toSortedMap[K, V](inputMap: Map[K, V])(implicit ordering: Ordering[K]): SortedMap[K, V]
Sorts the map by the keys and returns a SortedMap.
Sorts the map by the keys and returns a SortedMap.
- inputMap
the map to sort
- ordering
the order in which to sort the map
- returns
a SortedMap
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- 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()