public Experiment toExperiment(Experiment.Builder builder) { builder .seed(seed) .description(description) .filter(filter) .hashAttributes(Sets.newLinkedHashSet(hashAttributes)) .created(created) .modified(modified) .activated(activated) .deactivated(deactivated) .active(active); if (treatments != null) { for (final TreatmentEntity treatment : treatments) { builder.addTreatment(treatment.name, treatment.description); } } if (allocations != null) { for (final AllocationEntity allocation : allocations) { builder.addAllocation(allocation.treatment, allocation.offset, allocation.size); } } if (overrides != null) { for (final TreatmentOverrideEntity override : overrides) { builder.addOverride(override.name, override.filter, override.treatment); } } return builder.build(); }
/** * Gets a specific experiment by name */ public Experiment get(String experimentName) { final Experiment experiment = store.load( experimentName, new Experiment.Builder(this, experimentName) ); if (experiment != null) { strategy.onLoad(experiment, context); } return experiment; }
public Builder createBuilder(String experimentName) { return new Builder(owner, experimentName); } }