Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Identifiable
Represents an object that exposes a unique UUID.

Implementations of this interface contribute a {OBJECT.UUID} macro to the MacroStringMap, allowing the UUID of the object to be used in dynamically composed messages.

This is especially useful for identifying objects such as players, entities, or worlds, where the UUID serves as a persistent and unique reference.

  • Method Details

    • getUniqueId

      UUID getUniqueId()
      Returns the unique ID for this object.
      Returns:
      a UUID that uniquely identifies this object
    • extractUid

      default MacroStringMap extractUid(MacroKey baseKey, AdapterContextContainer ctx)
      Extracts a macro string map containing the UUID field.
      Parameters:
      baseKey - the top-level macro key
      ctx - the adapter context
      Returns:
      a MacroStringMap with the UUID value formatted as a string
    • formatUid

      static Optional<String> formatUid(UUID uniqueId)
      Returns an optional string representation of a UUID.
      Parameters:
      uniqueId - the UUID to format
      Returns:
      an Optional<String> if the UUID is non-null