Packages

object MapOps

Implicits for converting Maps.

Example:
  1. 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
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MapOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. implicit final class RichMap[K, V] extends AnyVal

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. 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

  9. 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

  10. 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

  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. 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

  15. 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

  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. 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

  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  22. 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

  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped