Class

org.scalatest

Entry

Related Doc: package scalatest

Permalink

case class Entry[K, V](key: K, value: V) extends Product with Serializable

A case class implementation of java.util.Map.Entry to make it easier to test Java Maps with ScalaTest Matchers.

In Java, java.util.Map is not a subtype of java.util.Collection, and does not actually define an element type. You can ask a Java Map for an “entry set” via the entrySet method, which will return the Map's key/value pairs wrapped in a set of java.util.Map.Entry, but a Map is not actually a collection of Entry. To make Java Maps easier to work with, however, ScalaTest matchers allows you to treat a Java Map as a collection of Entry, and defines this convenience implementation of java.util.Map.Entry. Here's how you use it:

javaMap should contain (Entry(2, 3))
javaMap should contain oneOf (Entry(2, 3), Entry(3, 4))

key

the key of this entry

value

the value of this entry

Source
Entry.scala
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Entry
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Entry(key: K, value: V)

    Permalink

    key

    the key of this entry

    value

    the value of this entry

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(other: Any): Boolean

    Permalink

    Compares the specified object with this entry for equality.

    Compares the specified object with this entry for equality.

    other

    the object to be compared for equality with this map entry

    returns

    true if the specified object is equal to this map entry

    Definition Classes
    Entry → Equals → AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def getKey: K

    Permalink

    Returns the key corresponding to this Entry.

    Returns the key corresponding to this Entry.

    returns

    the key corresponding to this entry

  11. def getValue: V

    Permalink

    Returns the value corresponding to this entry.

    Returns the value corresponding to this entry.

    returns

    the value corresponding to this entry

  12. def hashCode(): Int

    Permalink

    Returns the hash code value for this map entry.

    Returns the hash code value for this map entry.

    returns

    the hash code value for this map entry

    Definition Classes
    Entry → AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. val key: K

    Permalink

    the key of this entry

  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def setValue(v: V): V

    Permalink

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Exceptions thrown

    UnsupportedOperationException unconditionally

  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink

    Returns a String representation of this Entry consisting of concatenating the result of invoking toString on the key, an equals sign, and the result of invoking toString on the value.

    Returns a String representation of this Entry consisting of concatenating the result of invoking toString on the key, an equals sign, and the result of invoking toString on the value.

    returns

    a String already!

    Definition Classes
    Entry → AnyRef → Any
  21. val value: V

    Permalink

    the value of this entry

  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped