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

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

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

Feature.getUid介绍

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

代码示例

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

/** {@inheritDoc} */
@Override
public void putFeature(Feature feat) {
  if (feat == null) {
    throw new IllegalArgumentException("ff4j-core: Cannot insert null feature into cache");
  }
  if (feat.getUid() == null || feat.getUid().isEmpty()) {
    throw new IllegalArgumentException("ff4j-core: Cannot insert feature with null identifier into cache");
  }
  getFeaturesCache().put(feat.getUid(), new InMemoryCacheEntry<Feature>(feat));
}

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

/** {@inheritDoc} */
@Override
public void update(Feature fp) {
  if (fp == null) {
    throw new IllegalArgumentException("Feature cannot be null");
  }
  if (!exist(fp.getUid())) {
    throw new FeatureNotFoundException(fp.getUid());
  }
  getCache().put(new Element(fp.getUid(), fp));
}

代码示例来源: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());
  }
  getCache().put(new Element(fp.getUid(), fp));
}

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

/** {@inheritDoc} */
@Override
public void putFeature(Feature feat) {
  getCacheFeatures().put(new Element(feat.getUid(), feat));
}

代码示例来源: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());
  }
  getCacheManager().putFeature(fp); 
}

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

/** {@inheritDoc} */
@Override
public void update(Feature fp) {
  if (fp == null) {
    throw new IllegalArgumentException("Feature cannot be null nor empty");
  }
  read(fp.getUid());
  getFeaturesCollection().updateOne(BUILDER.getFeatUid(fp.getUid()), new Document(MONGO_SET, FMAPPER.toStore(fp)));
}

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

/** {@inheritDoc} */
@Override
public void putFeature(Feature feat) {
  getFeaturesCache().put(feat.getUid(), feat);
}

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

/** {@inheritDoc} */
@Override
public void update(Feature fp) {
  assertFeatureNotNull(fp);
  assertFeatureExist(fp.getUid());
  // easiest way to perform delta update (lot of attributes)
  delete(fp.getUid());
  create(fp);
}

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

public Collection<GroupDescApiBean> getAllGroups() {
  Map<String, GroupDescApiBean> groups = new HashMap<String, GroupDescApiBean>();
  Map<String, Feature> featureMap = ff4j.getFeatureStore().readAll();
  if (!CollectionUtils.isEmpty(featureMap)) {
    for (Feature feature : featureMap.values()) {
      initGroupMap(groups, feature.getUid(), feature.getGroup());
    }
  }
  return groups.values();
}

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

/** {@inheritDoc} */
@Override
public Map<String, Feature> readAll() {
  LinkedHashMap<String, Feature> mapFP = new LinkedHashMap<String, Feature>();
  for(Document document : getFeaturesCollection().find()) {
    Feature feature = FMAPPER.fromStore(document);
    mapFP.put(feature.getUid(), feature);
  }
  return mapFP;
}

代码示例来源: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());
  }
  getFeaturesCollection().insertOne(FMAPPER.toStore(fp));
}

代码示例来源: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());
  }
  getFeaturesCollection().save(MAPPER.toDBObject(fp));
}

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

/** {@inheritDoc} */
@Transactional
public void update(Feature newFeature) {
  Util.assertNotNull(newFeature);
  delete(newFeature.getUid());
  create(newFeature);
}

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

/** {@inheritDoc} */
@Override
@Transactional
public void create(Feature fp) {
  Util.assertNotNull(fp);
  if (exist(fp.getUid())) {
    throw new FeatureAlreadyExistException(fp.getUid());
  }
  createCoreFeature(fp);
  createPermissions(fp);
  createProperties(fp);
}

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

/** {@inheritDoc} */
@Override
public void update(Feature fp) {
  if (fp == null) {
    throw new IllegalArgumentException("Feature cannot be null nor empty");
  }
  read(fp.getUid());
  getFeaturesCollection().save(MAPPER.toDBObject(fp));
}

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

/** {@inheritDoc} */
@Override
public void update(Feature fp) {
  long start = System.nanoTime();
  target.update(fp);
  long duration = System.nanoTime() - start;
  publish(builder(ACTION_UPDATE).feature(fp.getUid()).duration(duration));
}

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

/** {@inheritDoc} */
@Override
public void create(Feature fp) {
  assertFeatureNotNull(fp);
  assertFeatureNotExist(fp.getUid());
  executePutCommand(MAPPER.toStore(fp));
}

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

/** {@inheritDoc} */
@Override
public void update(Feature fp) {
  assertFeatureNotNull(fp);
  assertFeatureExist(fp.getUid());
  getFeatureBucket().upsert(FEATURE_MAPPER.toStore(fp));
}

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

/** {@inheritDoc} */
@Override
public void create(Feature fp) {
  assertFeatureNotNull(fp);
  assertFeatureNotExist(fp.getUid());
  getFeatureBucket().upsert(FEATURE_MAPPER.toStore(fp));
}

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

/** {@inheritDoc} */
@Override
public void update(Feature fp) {
  assertFeatureNotNull(fp);
  assertFeatureExist(fp.getUid());
  getConnection().execute(getBuilder().queryUpdateFeature(fp));
}

相关文章