All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cloud.eppo.rac.dto.ExperimentConfiguration Maven / Gradle / Ivy

There is a newer version: 3.3.2
Show newest version
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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy