com.googlecode.objectify.Key.getKindHere()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中com.googlecode.objectify.Key.getKindHere()方法的一些代码示例,展示了Key.getKindHere()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.getKindHere()方法的具体详情如下:
包路径:com.googlecode.objectify.Key
类名称:Key
方法名:getKindHere

Key.getKindHere介绍

[英]Get the kind from the class if the class has an @Entity annotation, otherwise return null.
[中]

代码示例

代码示例来源:origin: objectify/objectify

/**
 * <p>Recursively looks for the @Entity annotation.</p>
 *
 * @return null if kind cannot be found
 */
private static String getKindRecursive(final Class<?> clazz) {
  if (clazz == Object.class)
    return null;
  final String kind = getKindHere(clazz);
  if (kind != null)
    return kind;
  else
    return getKindRecursive(clazz.getSuperclass());
}

代码示例来源:origin: com.googlecode.cedar-common/objectify

/**
 * Recursively climbs the class hierarchy looking for the first @Entity annotation.
 * @return the kind of the first @Entity found, or null if nothing can be found 
 */
private static String getRequiredEntityKind(Class<?> clazz)
{
  if (clazz == Object.class)
    return null;
  
  String kind = getKindHere(clazz);
  if (kind != null)
    return kind;
  else
    return getRequiredEntityKind(clazz.getSuperclass());
}

代码示例来源:origin: com.googlecode.cedar-common/objectify

String kind = getKindHere(clazz);
if (kind != null)
  return kind;

相关文章