
com.launchdarkly.client.FeatureStoreClientWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of launchdarkly-client Show documentation
Show all versions of launchdarkly-client Show documentation
Official LaunchDarkly SDK for Java
package com.launchdarkly.client;
import java.io.IOException;
import java.util.Map;
/**
* Provides additional behavior that the client requires before or after feature store operations.
* Currently this just means sorting the data set for init(). In the future we may also use this
* to provide an update listener capability.
*
* @since 4.6.1
*/
class FeatureStoreClientWrapper implements FeatureStore {
private final FeatureStore store;
public FeatureStoreClientWrapper(FeatureStore store) {
this.store = store;
}
@Override
public void init(Map, Map> allData) {
store.init(FeatureStoreDataSetSorter.sortAllCollections(allData));
}
@Override
public T get(VersionedDataKind kind, String key) {
return store.get(kind, key);
}
@Override
public Map all(VersionedDataKind kind) {
return store.all(kind);
}
@Override
public void delete(VersionedDataKind kind, String key, int version) {
store.delete(kind, key, version);
}
@Override
public void upsert(VersionedDataKind kind, T item) {
store.upsert(kind, item);
}
@Override
public boolean initialized() {
return store.initialized();
}
@Override
public void close() throws IOException {
store.close();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy