/** * @return the parent key, or null if there is no parent. Note that * the parent could potentially have any type. */ @SuppressWarnings("unchecked") public <V> Key<V> getParent() { if (this.parent == null && this.raw.getParent() != null) this.parent = new Key<V>(this.raw.getParent()); return (Key<V>)this.parent; }
} while ((key = key.getParent()) != null);
@Override public DatastoreKey parent() { Key parent = key.getParent(); if (parent != null) { return new DefaultDatastoreKey(parent); } return null; }