本文整理了Java中com.googlecode.objectify.Key.getRoot()
方法的一些代码示例,展示了Key.getRoot()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.getRoot()
方法的具体详情如下:
包路径:com.googlecode.objectify.Key
类名称:Key
方法名:getRoot
[英]Gets the root of a parent graph of keys. If a Key has no parent, it is the root.
[中]获取键的父图形的根。如果键没有父项,则它是根。
代码示例来源:origin: objectify/objectify
/**
* Gets the root of a parent graph of keys. If a Key has no parent, it is the root.
*
* @return the topmost parent key, or this object itself if it is the root.
* Note that the root key could potentially have any type.
*/
@SuppressWarnings("unchecked")
public <V> Key<V> getRoot() {
if (this.getParent() == null)
return (Key<V>)this;
else
return this.getParent().getRoot();
}
代码示例来源:origin: com.googlecode.cedar-common/objectify
/**
* Gets the root of a parent graph of keys. If a Key has no parent, it is the root.
*
* @return the topmost parent key, or this object itself if it is the root.
* Note that the root key could potentially have any type.
*/
@SuppressWarnings("unchecked")
public <V> Key<V> getRoot()
{
if (this.getParent() == null)
return (Key<V>)this;
else
return this.getParent().getRoot();
}
内容来源于网络,如有侵权,请联系作者删除!