Class AttributeKey<T>

java.lang.Object
dev.tachyonmcp.api.runtime.AttributeKey<T>
Type Parameters:
T - the type of value stored under this key

public final class AttributeKey<T> extends Object
A typed, identity-based key for InteractionContext.get(AttributeKey) / InteractionContext.set(AttributeKey, Object).

Two keys are equal only if they are the same instance — of(String) never interns by name, so unrelated features can never collide on a shared string, and a value can only be retrieved by whoever holds the actual key instance. The name exists solely for toString()/debugging.

Author:
Konstantin Pavlov
  • Method Details

    • of

      public static <T> AttributeKey<T> of(String name)
      Creates a new, distinct key.
      Type Parameters:
      T - the type of value stored under this key
      Parameters:
      name - debug label for the key (does not affect identity)
      Returns:
      a new distinct key instance
    • toString

      public String toString()
      Overrides:
      toString in class Object