org.ff4j.core.Feature.setEnable()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(119)

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

Feature.setEnable介绍

[英]Setter accessor for attribute 'enable'.
[中]属性“enable”的Setter访问器。

代码示例

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

/** {@inheritDoc} */
@Override
public void enableGroup(String groupName) {
  Map<String, Feature> featuresInGroup = readGroup(groupName);
  featuresInGroup.entrySet().forEach(kv -> {
    Feature f = kv.getValue();
    f.setGroup(groupName);
    f.setEnable(true);
    update(f);
  });
}

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

/** {@inheritDoc} */
@Override
public void disableGroup(String groupName) {
  Map<String, Feature> featuresInGroup = readGroup(groupName);
  featuresInGroup.entrySet().forEach(kv -> {
    Feature f = kv.getValue();
    f.setGroup(groupName);
    f.setEnable(false);
    update(f);
  });
}

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

@SuppressWarnings("unchecked")
private static Feature parseFeatureMap(Map<String, Object> fMap) {
  Feature f = new Feature((String) fMap.get("uid"));
  f.setEnable((Boolean) fMap.get("enable"));
  f.setDescription((String) fMap.get("description"));
  f.setGroup((String) fMap.get("group"));
  // permissions
  List<String> perm = (ArrayList<String>) fMap.get("permissions");
  f.setPermissions(new HashSet<String>());
  if (perm != null) {
    f.getPermissions().addAll(perm);
  }
  // flipping strategy
  f.setFlippingStrategy(parseFlipStrategy(f.getUid(), (LinkedHashMap<String, Object>) fMap.get("flippingStrategy")));
  // custom properties
  Map <String, Object > propertyMap = (Map < String, Object >) fMap.get("customProperties");
  f.setCustomProperties(parseCustomProperties(propertyMap));
  return f;
}

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

Bytes.toString(result.getValue(B_FEATURES_CF_CORE, B_FEAT_DESCRIPTION)));
fout.setEnable(
    Bytes.toBoolean(result.getValue(B_FEATURES_CF_CORE, B_FEAT_ENABLE)));

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

feature.setEnable(enable.getAsBoolean());

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

feat.setEnable(fApiBean.isEnable());
feat.setGroup(fApiBean.getGroup());
feat.setPermissions(new HashSet<String>(fApiBean.getPermissions()));

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

Feature f = new Feature(row.getString(COL_FEAT_UID));
f.setDescription(row.getString(COL_FEAT_DESCRIPTION));
f.setEnable(1 == row.getInt(COL_FEAT_ENABLE));
f.setGroup(row.getString(COL_FEAT_GROUPNAME));
f.setPermissions(mapFeaturePermissions(row));

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

public FeatureActions createOrUpdateFeature(String featureUID, FeatureApiBean featureApiBean) {
  featureValidator.assertFeatureUIDIsNotBlank(featureApiBean.getUid());
  featureValidator.assertFeatureIdsMatch(featureUID, featureApiBean.getUid());
  Feature feature = new Feature(featureUID);
  feature.setDescription(featureApiBean.getDescription());
  feature.setEnable(featureApiBean.isEnable());
  feature.setGroup(featureApiBean.getGroup());
  feature.setPermissions(new HashSet<String>(featureApiBean.getPermissions()));
  initFlippingStrategy(featureApiBean, feature);
  initProperties(featureApiBean, feature);
  if (ff4j.getFeatureStore().exist(featureUID)) {
    ff4j.getFeatureStore().update(feature);
    return FeatureActions.UPDATED;
  } else {
    ff4j.getFeatureStore().create(feature);
    return FeatureActions.CREATED;
  }
}

相关文章