org.ff4j.utils.Util.assertParamHasLength()方法的使用及代码示例

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

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

Util.assertParamHasLength介绍

[英]Parameter validation.
[中]参数验证。

代码示例

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

/** {@inheritDoc} */
@Override
public boolean existProperty(String name) {
  Util.assertParamHasLength(name, "Property name");
  return  wrapper.getCacheProperties().get(name) != null;
}

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

/** {@inheritDoc} */
@Override
public boolean exist(String uid) {
  Util.assertParamHasLength(uid, "Feature identifier");
  return getCache().get(uid) != null;
}

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

/** {@inheritDoc} */
@Override
public boolean exist(String uid) {
  Util.assertParamHasLength(uid, "Feature identifier");
  return getCacheManager().getFeature(uid) != null;
}

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

/** {@inheritDoc} */
@Override
public boolean existProperty(String name) {
  Util.assertParamHasLength(name, "Property name");
  return getCacheManager().getProperty(name) != null;
}

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

/** {@inheritDoc} */
@Override
public void grantRoleOnFeature(String flipId, String roleName) {
  Util.assertParamHasLength(roleName, "roleName (#2)");
  // retrieve
  Feature f = read(flipId);
  // modify
  f.getPermissions().add(roleName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public void removeRoleFromFeature(String flipId, String roleName) {
  Util.assertParamHasLength(roleName, "roleName (#2)");
  // retrieve
  Feature f = read(flipId);
  f.getPermissions().remove(roleName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public void removeRoleFromFeature(String flipId, String roleName) {
  Util.assertParamHasLength(roleName, "roleName (#2)");
  // retrieve
  Feature f = read(flipId);
  f.getPermissions().remove(roleName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public void removeRoleFromFeature(String flipId, String roleName) {
  Util.assertParamHasLength(roleName, "roleName (#2)");
  // retrieve
  Feature f = read(flipId);
  f.getPermissions().remove(roleName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public void grantRoleOnFeature(String flipId, String roleName) {
  Util.assertParamHasLength(roleName, "roleName (#2)");
  // retrieve
  Feature f = read(flipId);
  // modify
  f.getPermissions().add(roleName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public void grantRoleOnFeature(String flipId, String roleName) {
  Util.assertParamHasLength(roleName, "roleName (#2)");
  // retrieve
  Feature f = read(flipId);
  // modify
  f.getPermissions().add(roleName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public void grantRoleOnFeature(String flipId, String roleName) {
  Util.assertParamHasLength(roleName, "roleName (#2)");
  // retrieve
  Feature f = read(flipId);
  // modify
  f.getPermissions().add(roleName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public void removeRoleFromFeature(String flipId, String roleName) {
  Util.assertParamHasLength(roleName, "roleName (#2)");
  // retrieve
  Feature f = read(flipId);
  f.getPermissions().remove(roleName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public void addToGroup(String featureId, String groupName) {
  Util.assertParamHasLength(groupName, "groupName (#2)");
  // retrieve
  Feature f = read(featureId);
  f.setGroup(groupName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public void addToGroup(String featureId, String groupName) {
  Util.assertParamHasLength(groupName, "groupName (#2)");
  // retrieve
  Feature f = read(featureId);
  f.setGroup(groupName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public void addToGroup(String featureId, String groupName) {
  Util.assertParamHasLength(groupName, "groupName (#2)");
  // retrieve
  Feature f = read(featureId);
  f.setGroup(groupName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public void addToGroup(String featureId, String groupName) {
  Util.assertParamHasLength(groupName, "groupName (#2)");
  // retrieve
  Feature f = read(featureId);
  f.setGroup(groupName);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public boolean existProperty(String name) {
  Util.assertParamHasLength(name, "Property name");
  return getDriver().existKey(getDriver().getPropertyKey(name));
}

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

/** {@inheritDoc} */
@Override
public boolean exist(String uid) {
  Util.assertParamHasLength(uid, "Feature identifier");
  // or : getDriver().getFeatureList().contains(uid)
  return getDriver().existKey(getDriver().getFeatureKey(uid));
}

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

/** {@inheritDoc} */
@Override
public void removeFromGroup(String featureId, String groupName) {
  Util.assertParamHasLength(groupName, "groupName (#2)");
  if (!existGroup(groupName)) {
    throw new GroupNotFoundException(groupName);
  }
  // retrieve
  Feature f = read(featureId);
  f.setGroup(null);
  // persist modification
  update(f);
}

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

/** {@inheritDoc} */
@Override
public boolean existGroup(String groupName) {
  Util.assertParamHasLength(groupName, "groupName");
  SearchResult result = getConnection().search(getBuilder().getGroupByGroupName(groupName), true);
  return (result.getTotal() != null) && (result.getTotal() >= 1);
}

相关文章