cloud.eppo.rac.dto.ExperimentConfiguration 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.rac.dto;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** Experiment Configuration Class */
public class ExperimentConfiguration {
private final String name;
private final boolean enabled;
private final int subjectShards;
private final Map typedOverrides = new HashMap<>();
private final Map allocations;
private final List rules;
@JsonCreator
public ExperimentConfiguration(
@JsonProperty("name") String name,
@JsonProperty("enabled") boolean enabled,
@JsonProperty("subjectShards") int subjectShards,
@JsonProperty("allocations") Map allocations,
@JsonProperty("rules") List rules) {
this.name = name;
this.enabled = enabled;
this.subjectShards = subjectShards;
this.allocations = allocations;
this.rules = rules;
}
public Allocation getAllocation(String allocationKey) {
return allocations.get(allocationKey);
}
public String getName() {
return name;
}
public boolean isEnabled() {
return enabled;
}
public int getSubjectShards() {
return subjectShards;
}
public Map getTypedOverrides() {
return typedOverrides;
}
public List getRules() {
return rules;
}
public Map getAllocations() {
return allocations;
}
}