Record Class Metrics.Tag.CommandInvocation
java.lang.Object
java.lang.Record
dev.sympho.modular_commands.execute.Metrics.Tag.CommandInvocation
- Record Components:
invocation- The invocation.canonical-trueif the invocation is the canonical one (with aliases resolved).falseif the invocation is the one called by user (may have aliases).
- All Implemented Interfaces:
Metrics.Tag
- Enclosing interface:
- Metrics.Tag
public static record Metrics.Tag.CommandInvocation(Invocation invocation, boolean canonical)
extends Record
implements Metrics.Tag
The tag that indicates the command invocation.
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.sympho.modular_commands.execute.Metrics.Tag
Metrics.Tag.Caller, Metrics.Tag.Channel, Metrics.Tag.CommandId, Metrics.Tag.CommandInvocation, Metrics.Tag.Guild, Metrics.Tag.Type -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCommandInvocation(Invocation invocation, boolean canonical) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncalled(Invocation invocation) Creates a tag with the given called invocation as value.booleanReturns the value of thecanonicalrecord component.canonical(Invocation invocation) Creates a tag with the given canonical invocation as value.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinvocationrecord component.key()Retrieves the tag key.final StringtoString()Returns a string representation of this record class.value()Retrieves the tag value.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.sympho.modular_commands.execute.Metrics.Tag
apply, apply
-
Field Details
-
NAME_PREFIX
The prefix for the tag names.- See Also:
-
-
Constructor Details
-
CommandInvocation
Creates a new instance.- Parameters:
invocation- The invocation.canonical-trueif the invocation is the canonical one (with aliases resolved).falseif the invocation is the one called by user (may have aliases).
-
-
Method Details
-
called
Creates a tag with the given called invocation as value.- Parameters:
invocation- The invocation.- Returns:
- The created tag.
-
canonical
Creates a tag with the given canonical invocation as value.- Parameters:
invocation- The invocation.- Returns:
- The created tag.
-
key
Description copied from interface:Metrics.TagRetrieves the tag key.- Specified by:
keyin interfaceMetrics.Tag- Returns:
- The tag key.
-
value
Description copied from interface:Metrics.TagRetrieves the tag value.- Specified by:
valuein interfaceMetrics.Tag- Returns:
- The tag value.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
invocation
Returns the value of theinvocationrecord component.- Returns:
- the value of the
invocationrecord component
-
canonical
public boolean canonical()Returns the value of thecanonicalrecord component.- Returns:
- the value of the
canonicalrecord component
-