org.crsh.util.Utils.instanceOf()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(163)

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

Utils.instanceOf介绍

暂无

代码示例

代码示例来源:origin: crashub/crash

public static boolean instanceOf(Class c, List<String> types) {
 for (String type: types) {
  if (instanceOf(c, type)) {
   return true;
  }
 }
 return false;
}

代码示例来源:origin: crashub/crash

public static boolean instanceOf(Class c, String type) {
 if (c.getName().equals(type)) {
  return true;
 }
 for (Class i : c.getInterfaces()) {
  if (instanceOf(i, type)) {
   return true;
  }
 }
 if (c.getSuperclass() != null) {
  return instanceOf(c.getSuperclass(), type);
 }
 return false;
}

代码示例来源:origin: crashub/crash

public void testInstanceOfList() {
 assertEquals(true, Utils.instanceOf(String.class, Arrays.asList("java.lang.String", "java.lang.Integer")));
 assertEquals(true, Utils.instanceOf(String.class, Arrays.asList("java.lang.Integer", "java.lang.String")));
 assertEquals(false, Utils.instanceOf(String.class, Arrays.asList("java.lang.Boolean", "java.lang.Integer")));
}

代码示例来源:origin: crashub/crash

public void testInstanceOf() {
 assertEquals(true, Utils.instanceOf(String.class, "java.lang.String"));
 assertEquals(true, Utils.instanceOf(ArrayList.class, "java.util.List"));
 assertEquals(true, Utils.instanceOf(List.class, "java.util.List"));
 assertEquals(true, Utils.instanceOf(ArrayList.class, "java.util.AbstractList"));
 assertEquals(true, Utils.instanceOf(ArrayList.class, "java.util.AbstractCollection"));
 assertEquals(false, Utils.instanceOf(String.class, "java.lang.Integer"));
}

代码示例来源:origin: crashub/crash

filters == null ||
   filters.size() == 0 ||
   Utils.instanceOf(instance.getObject().getClass(), filters)) {
if (pattern == null || pattern.matcher(fullName).find()) {
 data.add(new BindingRenderer.BindingData(fullName, instance.getClassName(), instance, verbose));

代码示例来源:origin: org.crashub/crash.shell

public static boolean instanceOf(Class c, List<String> types) {
 for (String type: types) {
  if (instanceOf(c, type)) {
   return true;
  }
 }
 return false;
}

代码示例来源:origin: com.github.corda.crash/crash.shell

public static boolean instanceOf(Class c, List<String> types) {
 for (String type: types) {
  if (instanceOf(c, type)) {
   return true;
  }
 }
 return false;
}

代码示例来源:origin: org.crashub/crash.shell

public static boolean instanceOf(Class c, String type) {
 if (c.getName().equals(type)) {
  return true;
 }
 for (Class i : c.getInterfaces()) {
  if (instanceOf(i, type)) {
   return true;
  }
 }
 if (c.getSuperclass() != null) {
  return instanceOf(c.getSuperclass(), type);
 }
 return false;
}

代码示例来源:origin: com.github.corda.crash/crash.shell

public static boolean instanceOf(Class c, String type) {
 if (c.getName().equals(type)) {
  return true;
 }
 for (Class i : c.getInterfaces()) {
  if (instanceOf(i, type)) {
   return true;
  }
 }
 if (c.getSuperclass() != null) {
  return instanceOf(c.getSuperclass(), type);
 }
 return false;
}

代码示例来源:origin: com.github.corda.crash/crash.shell

filters == null ||
   filters.size() == 0 ||
   Utils.instanceOf(instance.getObject().getClass(), filters)) {
if (pattern == null || pattern.matcher(fullName).find()) {
 data.add(new BindingRenderer.BindingData(fullName, instance.getClassName(), instance, verbose));

代码示例来源:origin: org.crashub/crash.shell

filters == null ||
   filters.size() == 0 ||
   Utils.instanceOf(instance.getObject().getClass(), filters)) {
if (pattern == null || pattern.matcher(fullName).find()) {
 data.add(new BindingRenderer.BindingData(fullName, instance.getClassName(), instance, verbose));

相关文章