Interface Identifiable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
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 Summary
Modifier and TypeMethodDescriptiondefault MacroStringMap
extractUid
(MacroKey baseKey, AdapterContextContainer ctx) Extracts a macro string map containing the UUID field.Returns an optional string representation of a UUID.Returns the unique ID for this object.
-
Method Details
-
getUniqueId
UUID getUniqueId()Returns the unique ID for this object.- Returns:
- a UUID that uniquely identifies this object
-
extractUid
Extracts a macro string map containing the UUID field.- Parameters:
baseKey
- the top-level macro keyctx
- the adapter context- Returns:
- a
MacroStringMap
with the UUID value formatted as a string
-
formatUid
Returns an optional string representation of a UUID.- Parameters:
uniqueId
- the UUID to format- Returns:
- an
Optional<String>
if the UUID is non-null
-