Interface Variation


public interface Variation
Representation of the /variations list element.
Since:
0.5
  • Method Details

    • getSchema

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

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

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

      Optional<Variation.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 variation.
      Since:
      0.5
    • getControlExperience

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

      boolean isOn()
      Is this variation currently online, as provided by the /variations[]/isOn key. All sessions are implicitly disqualified for an offline variation, as if it did not exist at all. None of this variation'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<VariationHook> getHooks()
      List of variation-scoped lifecycle hooks, as provided by the /variations[]/hooks key.
      Returns:
      An immutable list of VariationHook objects in ordinal order.
      Since:
      0.7
    • getOnStates

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

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

      List<Variation> getConcurrentVariations()
      The variations declared as concurrent with this variation, as provided by the /variations[]/concurrentVariations key.
      Returns:
      An immutable list of concurrent variations in ordinal order.
      Since:
      0.5
    • getDurability

      Durability getDurability()
      The durability settings of this variation, as provided by the /variations[]/durability key.
      Since:
      0.10
    • isSerialWith

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

      boolean isConcurrentWith(Variation other)
      Is this variation concurrent with a given variation. Non-serial variations can only be targeted independently, if they are defined concurrent in the schema. This declaration signals Variant server that the two variations can be targeted independently, as if they were serial. This implies that the host application programmer has implemented all hybrid state variants.
      Since:
      0.5
    • getParameters

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

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