Class VKey<T>

java.lang.Object
google.registry.model.ImmutableObject
google.registry.persistence.VKey<T>
All Implemented Interfaces:
Serializable, Cloneable

public class VKey<T> extends ImmutableObject implements Serializable
VKey is an abstraction that encapsulates the key concept.

A VKey instance must contain the JPA primary key for the referenced entity class.

See Also:
  • Method Details

    • create

      public static <T> VKey<T> create(Class<T> kind, Serializable key)
      Creates a VKey with supplied the SQL primary key.
    • createEppVKeyFromString

      public static <T extends EppResource> VKey<T> createEppVKeyFromString(String keyString)
      Constructs a VKey for an EppResource from the string representation.

      The string representation is obtained from the stringify() function and like this: kind:SomeEntity@sql:rO0ABXQAA2Zvbw

    • getKind

      public Class<? extends T> getKind()
      Returns the type of the entity.
    • getKey

      public Serializable getKey()
      Returns the primary key.
    • stringify

      public String stringify()
      Constructs the string representation of a VKey.

      The string representation contains its kind and Base64 SQL key, in the following format: kind:class_name@sql:encoded_sqlKey.

    • toString

      public String toString()
      Constructs the readable string representation of a VKey.
      Overrides:
      toString in class ImmutableObject