Class Experiments

java.lang.Object
io.rtr.alchemy.models.Experiments
All Implemented Interfaces:
Closeable, AutoCloseable

public class Experiments extends Object implements Closeable
The main class for accessing experiments
  • Method Details

    • using

      public static Experiments.Builder using(ExperimentsStoreProvider provider)
    • getActiveTreatment

      public Treatment getActiveTreatment(String experimentName, Identity identity)
      Returns the current active treatment for an experiment name and identity, taking overrides into account
    • getActiveExperiments

      public Iterable<Experiment> getActiveExperiments()
      Returns all active experiments
    • getActiveTreatments

      public Map<Experiment,Treatment> getActiveTreatments(Identity identity)
      Returns all active treatments for all active experiments for an identity, taking overrides into account
    • find

      public Iterable<Experiment> find(Filter filter)
      Finds an experiment given a set of criteria
    • find

      public Iterable<Experiment> find()
      Finds all experiments
    • get

      public Experiment get(String experimentName)
      Gets a specific experiment by name
    • delete

      public void delete(String experimentName)
      Deletes a specific experiment by name
    • save

      public void save(Experiment experiment) throws javax.validation.ValidationException
      Persists a specific experiment by name
      Throws:
      javax.validation.ValidationException
    • create

      public Experiment create(String name) throws javax.validation.ValidationException
      Creates a new experiment by name, which is not persisted until save is called
      Throws:
      javax.validation.ValidationException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException