org.nutz.lang.Lang.isEmptyArray()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(139)

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

Lang.isEmptyArray介绍

[英]判断一个数组是否是空数组
[中]判断一个数组是否是空数组

代码示例

代码示例来源:origin: nutzam/nutz

public static boolean isAnnotationExists(Method method,
                     Class<? extends Annotation>... classes) {
  if (!Lang.isEmptyArray(classes)) {
    for (Class<? extends Annotation> klass : classes) {
      if (getAnnotationDeep(method, klass) != null)
        return true;
    }
  }
  return false;
}

代码示例来源:origin: nutzam/nutz

public static boolean isAnnotationExists(Class<?> type,
                       Class<? extends Annotation>... classes) {
    if (!Lang.isEmptyArray(classes)) {
      for (Class<? extends Annotation> klass : classes) {
        if (getAnnotationDeep(type, klass) != null)
          return true;
      }
    }
    return false;
  }
}

代码示例来源:origin: nutzam/nutz

/**
 * 当所有字段增加完成,这个方法必须被调用,用来搜索复合主键
 * 
 * @param names
 *            复合主键的 Java 字段名数组
 */
public void checkCompositeFields(String[] names) {
  if (!Lang.isEmptyArray(names) && names.length > 1) {
    for (String name : names) {
      if (byJava.containsKey(name) && byJava.get(name).isCompositePk())
        theComposites.add(byJava.get(name));
      else
        throw Lang.makeThrow("Fail to find comosite field '%s' in class '%s'!",
                   name,
                   type.getName());
    }
    this.pkType = PkType.COMPOSITE;
  } else if (null != this.theId) {
    this.pkType = PkType.ID;
  } else if (null != this.theName) {
    this.pkType = PkType.NAME;
  }
}

代码示例来源:origin: nutzam/nutz

if (!Lang.isEmptyArray(delIndexSqls)) {
  dao.execute(delIndexSqls);
if (!Lang.isEmptyArray(addIndexSqls)) {
  dao.execute(addIndexSqls);

代码示例来源:origin: nutzam/nutzboot

public void init() {
  if (Lang.isEmptyArray(objs)) {
    return;
  }
  for (FreemarkerDirective freemarkerDirective : objs) {
    list.add(freemarkerDirective);
  }
}

代码示例来源:origin: nutzam/nutzboot

public FreemarkerDirectiveFactory create(FreemarkerDirective... objs) {
    if (Lang.isEmptyArray(objs)) {
      return this;
    }
    for (FreemarkerDirective freemarkerDirective : objs) {
      list.add(freemarkerDirective);
    }
    return this;
  }
}

代码示例来源:origin: org.nutz/nutz

public static boolean isAnnotationExists(Method method,
                     Class<? extends Annotation>... classes) {
  if (!Lang.isEmptyArray(classes)) {
    for (Class<? extends Annotation> klass : classes) {
      if (getAnnotationDeep(method, klass) != null)
        return true;
    }
  }
  return false;
}

代码示例来源:origin: org.nutz/nutz

public static boolean isAnnotationExists(Class<?> type,
                       Class<? extends Annotation>... classes) {
    if (!Lang.isEmptyArray(classes)) {
      for (Class<? extends Annotation> klass : classes) {
        if (getAnnotationDeep(type, klass) != null)
          return true;
      }
    }
    return false;
  }
}

代码示例来源:origin: org.nutz/nutz

/**
 * 当所有字段增加完成,这个方法必须被调用,用来搜索复合主键
 * 
 * @param names
 *            复合主键的 Java 字段名数组
 */
public void checkCompositeFields(String[] names) {
  if (!Lang.isEmptyArray(names) && names.length > 1) {
    for (String name : names) {
      if (byJava.containsKey(name) && byJava.get(name).isCompositePk())
        theComposites.add(byJava.get(name));
      else
        throw Lang.makeThrow("Fail to find comosite field '%s' in class '%s'!",
                   name,
                   type.getName());
    }
    this.pkType = PkType.COMPOSITE;
  } else if (null != this.theId) {
    this.pkType = PkType.ID;
  } else if (null != this.theName) {
    this.pkType = PkType.NAME;
  }
}

代码示例来源:origin: Rekoe/rk_svnadmin

public static void createTablesInPackage(Dao dao, Class<?> $clazz, boolean delReCreate, Class<?>... ignoreClzs) {
    boolean haveIgnoreClazz = !Lang.isEmptyArray(ignoreClzs);
    for (Class<?> klass : Scans.me().scanPackage($clazz.getPackage().getName())) {
      if (klass.getAnnotation(Table.class) != null) {
        boolean isContinue = false;
        if (haveIgnoreClazz) {
          for (Class<?> clazz : ignoreClzs) {
            if (clazz == klass) {
              isContinue = true;
              break;
            }
          }
        }
        if (isContinue)
          continue;
        dao.create(klass, delReCreate);
      }
    }
  }
}

代码示例来源:origin: Rekoe/rk_svnadmin

public static void migration(Dao dao, String packageName, Object nameTable, Class<?>... ignoreClzs) {
  boolean haveIgnoreClazz = !Lang.isEmptyArray(ignoreClzs);
  for (Class<?> klass : Scans.me().scanPackage(packageName)) {
    if (klass.getAnnotation(Table.class) != null) {
      boolean isContinue = false;
      if (haveIgnoreClazz) {
        for (Class<?> clazz : ignoreClzs) {
          if (clazz == klass) {
            isContinue = true;
            break;
          }
        }
      }
      if (isContinue)
        continue;
      Daos.migration(dao, klass, true, true, nameTable);
    }
  }
}

代码示例来源:origin: nutzam/nutzboot

public void init() {
  Map<String, CacheStrategy> map = new HashMap<>();
  String[] types = ioc.getNamesByType(KeyStringifier.class);
  if (Lang.isEmptyArray(types)) {
    this.stringifier = String::valueOf;
  } else {

代码示例来源:origin: org.nutz/nutz

if (!Lang.isEmptyArray(delIndexSqls)) {
  dao.execute(delIndexSqls);
if (!Lang.isEmptyArray(addIndexSqls)) {
  dao.execute(addIndexSqls);

代码示例来源:origin: Rekoe/rk_svnadmin

public void update(long uid, String password, boolean isLocked, Integer[] ids) {
  User user = fetch(uid);
  dao().clearLinks(user, "roles");
  if (!Lang.isEmptyArray(ids)) {
    user.setRoles(dao().query(Role.class, Cnd.where("id", "in", ids)));
  }
  if (StringUtils.isNotBlank(password)) {
    String salt = new SecureRandomNumberGenerator().nextBytes().toBase64();
    user.setSalt(salt);
    user.setPassword(new Sha256Hash(password, salt, 1024).toBase64());
  }
  user.setLocked(isLocked);
  dao().update(user);
  if (!Lang.isEmpty(user.getRoles())) {
    dao().insertRelation(user, "roles");
  }
}

相关文章