cloud.eppo.ConfigurationStore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-common-jvm Show documentation
Show all versions of sdk-common-jvm Show documentation
Eppo SDK for JVM shared library
package cloud.eppo;
import cloud.eppo.api.Configuration;
import java.util.concurrent.CompletableFuture;
import org.jetbrains.annotations.NotNull;
/** Memory-only configuration store. */
public class ConfigurationStore implements IConfigurationStore {
// this is the fallback value if no configuration is provided (i.e. by fetch or initial config).
@NotNull private volatile Configuration configuration = Configuration.emptyConfig();
public ConfigurationStore() {}
public CompletableFuture saveConfiguration(@NotNull final Configuration configuration) {
this.configuration = configuration;
return CompletableFuture.completedFuture(null);
}
@NotNull public Configuration getConfiguration() {
return configuration;
}
}