Interface Experiment


public interface Experiment
Representation of the /experiments list element.
Since:
0.5
  • Method Details

    • getSchema

      Schema getSchema()
      The containing experiment schema.
      Since:
      0.6
    • getName

      String getName()
      This experiment's name, as provided by the /experiments[]/name element.
      Since:
      0.5
    • getExperiences

      List<Experiment.Experience> getExperiences()
      This experiment's experiences, as provided by the /experiments[]/experiences element.
      Returns:
      An immutable list of Experiment.Experience objects in ordinal order.
      Since:
      0.5
    • getExperience

      Optional<Experiment.Experience> getExperience(String name)
      Get an experience by its name.
      Returns:
      An Optional, containing the experience with the given name, or empty if no such experience in this experiment.
      Since:
      0.5
    • getControlExperience

      Experiment.Experience getControlExperience()
      Get this experiment's control experience.
      Returns:
      An Experiment.Experience object. Cannot be null.
      Since:
      0.5
    • isOn

      boolean isOn()
      Is this experiment currently online, as provided by the /experiments[]/isOn key. All sessions are implicitly disqualified for an offline experiment, as if it did not exist at all. None of this experiment's experiences will appear in the list of a session's live experiences.
      Returns:
      true if the test is online, false if not.
      Since:
      0.5
    • getHooks

      List<ExperimentHook> getHooks()
      List of experiment-scoped lifecycle hooks, as provided by the /experiments[]/hooks key.
      Returns:
      An immutable list of ExperimentHook objects in ordinal order.
      Since:
      0.7
    • getOnStates

      List<Experiment.OnState> getOnStates()
      List of this experiment's state instrumentations, as provided by the /experiments[]/onStates key.
      Returns:
      An immutable list of objects of type Experiment.OnState. Cannot be null.
      Since:
      0.5
    • getOnState

      Optional<Experiment.OnState> getOnState(State state)
      This experiment's instrumentation details on a given state, as provided by an element of the /experiments[]/onStates sequence key.
      Returns:
      An Optional, containing an Experiment.OnState instance for the given state, or empty if given state is not instrumented by this experiment.
      Since:
      0.5
    • getConcurrentExperiments

      List<Experiment> getConcurrentExperiments()
      The experiments declared as concurrent with this experiment, as provided by the /experiments[]/concurrentWith key.
      Returns:
      An immutable list of concurrent experiments in ordinal order.
      Since:
      0.5
    • getTimeToLive

      TimeToLive getTimeToLive()
      The time-to-live settings of this experiment, as provided by the /experiments[]/timeToLive key.
      Since:
      0.10
    • isSerialWith

      boolean isSerialWith(Experiment other)
      Is this experiment serial with a given experiment. Two experiments are serial if there are no states instrumented by both. Serial experiments can always be targeted independently without any constraints. Note, that this method is not the opposite of isConcurrentWith(Experiment): two experiments can have states in common (and thus non-serial) but not declared as concurrent. Returns false if other.equals(this).
      Since:
      0.5
    • isConcurrentWith

      boolean isConcurrentWith(Experiment other)
      Is a given experiment declared as concurrent with this experiment,or vice versa. Note, that if two experiments are in fact concurrent (i.e. have states in common) but are not declared as concurrent, both this method and isSerialWith(Experiment) return false. Emits runtime exception if other.equals(this).
      Since:
      0.5
    • isImplicitlyConcurrentWith

      default boolean isImplicitlyConcurrentWith(Experiment other)
      Is a given experiment neither serial with (i.e. has states in common) nor declared as concurrent with this experiment. Emits runtime exception if other.equals(this).
      Since:
      1.4
    • getParameters

      Map<String,String> getParameters()
      Experiment parameters defined by this experiment.
      Returns:
      An immutable map of experiment parameters.
      Since:
      1.0
    • isInstruments

      boolean isInstruments(State state)
      Does this experiment instrument a given state?
      Since:
      1.0