Class VKey<T>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class VKey<T>
    extends ImmutableObject
    implements java.io.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:
    Serialized Form
    • Method Detail

      • create

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

        public static <T extends EppResourceVKey<T> createEppVKeyFromString​(java.lang.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 java.lang.Class<? extends T> getKind()
        Returns the type of the entity.
      • getKey

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

        public java.lang.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 java.lang.String toString()
        Constructs the readable string representation of a VKey.
        Overrides:
        toString in class ImmutableObject