Class TypedKey<A>

java.lang.Object
play.libs.typedmap.TypedKey<A>

public final class TypedKey<A> extends Object
A TypedKey is a key that can be used to get and set values in a TypedMap or any object with typed keys. This class uses reference equality for comparisons, so each new instance is different key.
  • Constructor Details

    • TypedKey

      public TypedKey(play.api.libs.typedmap.TypedKey<A> underlying)
  • Method Details

    • asScala

      public play.api.libs.typedmap.TypedKey<A> asScala()
      Returns:
      the underlying Scala TypedKey which this instance wraps.
    • bindValue

      public TypedEntry<A> bindValue(A value)
      Bind this key to a value.
      Parameters:
      value - The value to bind this key to.
      Returns:
      A bound value.
    • create

      public static <A> TypedKey<A> create()
      Creates a TypedKey without a name.
      Type Parameters:
      A - The type of value this key is associated with.
      Returns:
      A fresh key.
    • create

      public static <A> TypedKey<A> create(String displayName)
      Creates a TypedKey with the given name.
      Type Parameters:
      A - The type of value this key is associated with.
      Parameters:
      displayName - The name to display when printing this key.
      Returns:
      A fresh key.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object