public class Key<T> extends Object implements Serializable, Comparable<Key<?>>
The key object; this class is take from the app-engine datastore (mostly) implementation. It is also Serializable and GWT-safe, enabling your entity objects to be used for GWT RPC should you so desire.
You may use normal DBRef objects as relationships in your entities if you desire neither type safety nor GWT-ability.
Constructor and Description |
---|
Key(Class<? extends T> kind,
byte[] idBytes)
Create a key with an id
|
Key(Class<? extends T> kind,
Object id)
Create a key with an id
|
Key(String kind,
Object id)
Create a key with an id
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Key<?> other)
Compares based on the following traits, in order:
|
boolean |
equals(Object obj) |
Object |
getId() |
String |
getKind() |
Class<? extends T> |
getKindClass() |
int |
hashCode() |
void |
setKind(String newKind)
sets the collection-name.
|
void |
setKindClass(Class<? extends T> clazz) |
String |
toString()
Creates a human-readable version of this key
|
public Object getId()
public String getKind()
public void setKind(String newKind)
public int compareTo(Key<?> other)
Compares based on the following traits, in order:
compareTo
in interface Comparable<Key<?>>
Copyright © 2015. All rights reserved.