use of org.ff4j.arangodb.document.ArangoDBFeature in project ff4j by ff4j.
the class FeatureStoreArangoDB method updateFeature.
private void updateFeature(Feature fp) {
try {
ArangoDBFeature arangoDBFeature = StoreMapper.toFeatureStore(fp);
featureClient.replaceDocument(fp.getUid(), arangoDBFeature);
} catch (ArangoDBException e) {
throw new FeatureAccessException(fp.getUid(), e);
}
}
use of org.ff4j.arangodb.document.ArangoDBFeature in project ff4j by ff4j.
the class FeatureStoreArangoDB method create.
/**
* {@inheritDoc}
*/
@Override
public void create(final Feature fp) {
assertFeatureNotNull(fp);
assertFeatureNotExist(fp.getUid());
ArangoDBFeature arangoDbFeature = StoreMapper.toFeatureStore(fp);
insertFeature(arangoDbFeature);
}
use of org.ff4j.arangodb.document.ArangoDBFeature in project ff4j by ff4j.
the class StoreMapper method fromFeatureStore.
public static Feature fromFeatureStore(ArangoDBFeature f) {
Map<String, Property<?>> customProperties = convertMap(f.getCustomProperties(), StoreMapper::fromPropertyStore);
Feature feature = new Feature(f.getId());
feature.setEnable(f.isEnable());
feature.setDescription(f.getDescription());
feature.setGroup(f.getGroup());
feature.setPermissions(f.getPermissions());
feature.setFlippingStrategy(f.getFlippingStrategy());
feature.setCustomProperties(customProperties);
return feature;
}
Aggregations