Class AllureExternalKey

java.lang.Object
io.qameta.allure.AllureExternalKey

public final class AllureExternalKey extends Object
Adapter-owned lifecycle identity.

A key is a recomputable identity built from framework data: reconstruct the same key in the start and stop hooks and equal keys resolve to the same internal Allure item, so neither the adapter nor the lifecycle needs a Map<frameworkId, uuid>. The namespace is the integration class (provenance, and no ad-hoc constant strings); the values are the framework data that identifies the entity.

The key reduces its values to a digest at construction and retains no framework objects. Value contract: at least one value (enforced by the signature), no null values, no array values, and every value must have a stable, value-based serialized form (String.valueOf) for the lifetime of the run. The key must be unique per live entity: a retry of the same test must not recompute an equal key while the previous entity is still unwritten — include an attempt counter in the values when the framework can re-run the same id within one run.

Keys are process-local and in-memory only; they are never serialized into result files.

  • Method Details

    • of

      public static AllureExternalKey of(Class<?> namespace, Object first, Object... rest)
      Creates a key with the given namespace class and at least one identifying value.
      Parameters:
      namespace - the integration class that owns the key
      first - the first identifying value (required)
      rest - the remaining identifying values
      Returns:
      the key
    • random

      public static AllureExternalKey random(Class<?> namespace)
      Creates a key with the given namespace class and a random UUIDv4 value, for frameworks that expose no stable id.
      Parameters:
      namespace - the integration class that owns the key
      Returns:
      the key
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object