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

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

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

Feature.getProperty介绍

[英]Accessor to read a custom property from Feature.
[中]用于从功能读取自定义属性的访问器。

代码示例

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

ap = current.getProperty(uid);
ap.setDescription(description);
if (ap.getType().equalsIgnoreCase(type)) {

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

/** {@inheritDoc} */
@Override
public void update(Feature fp) {
  Util.assertNotNull(fp);
  Util.assertHasLength(fp.getUid());
  // Check existence
  read(fp.getUid());
  // Create or update core Feature as a first TX
  Transaction tx = graphDb.beginTx();
  graphDb.execute(createUpdateCoreFeature(fp));
  tx.success();
  
  // Create, update or delete Flipping Strategy
  updateFlippingStrategy(fp);
  // Update groups
  updateGroups(fp);
  // Properties
  Transaction tx3 = graphDb.beginTx();
  Map<String, Object> paramUID = new HashMap<>();
  paramUID.put("uid", fp.getUid());
  graphDb.execute(QUERY_CYPHER_DELETE_PROPERTIES_FEATURE, paramUID);
  tx3.success();
  
  if (fp.getCustomProperties() != null && fp.getCustomProperties().size() > 0) {
    for (String pName : fp.getCustomProperties().keySet()) {
      createProperty(fp.getProperty(pName), fp.getUid());
    }
  }
}

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

/** {@inheritDoc} */
@Override
public void create(Feature fp) {
  if (fp == null) {
    throw new IllegalArgumentException("Feature cannot be null nor empty");
  }
  if (exist(fp.getUid())) {
    throw new FeatureAlreadyExistException(fp.getUid());
  }
  Transaction tx = graphDb.beginTx();
  // Create core
  graphDb.execute(createQueryNewCoreFeature(fp));
  // Create Flipping Strategy
  if (fp.getFlippingStrategy() != null) {
    graphDb.execute(createQueryFlippingStrategy(fp));
  }
  // Create Group
  if (fp.getGroup() != null && !"".equals(fp.getGroup())) {
    addToGroup(fp.getUid(), fp.getGroup());
  }
  tx.success();
  // Create Properties
  if (fp.getCustomProperties() != null && fp.getCustomProperties().size() > 0) {
    for (String pName : fp.getCustomProperties().keySet()) {
      createProperty(fp.getProperty(pName), fp.getUid());
    }
  }
}

相关文章