Record Class Metrics.Tag.Guild
java.lang.Object
java.lang.Record
dev.sympho.modular_commands.execute.Metrics.Tag.Guild
- Record Components:
id- The guild ID, ornullif called from a private channel.
- All Implemented Interfaces:
Metrics.Tag
- Enclosing interface:
- Metrics.Tag
public static record Metrics.Tag.Guild(@Nullable Snowflake id)
extends Record
implements Metrics.Tag
The tag that indicates the guild that the command was called from, if any.
- 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
FieldsModifier and TypeFieldDescriptionstatic final Metrics.Tag.GuildThe tag for a direct message (where there is no guild).static final StringThe tag value for a direct message. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static Metrics.Tag.GuildCreates a tag with the given id as value.static Metrics.Tag.GuildCreates a tag with the given id as value.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord 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
-
DM_VALUE
The tag value for a direct message.- See Also:
-
DM
The tag for a direct message (where there is no guild). In this case, the value of the tag is "none".
-
-
Constructor Details
-
Guild
Creates an instance of aGuildrecord class.- Parameters:
id- the value for theidrecord component
-
-
Method Details
-
from
Creates a tag with the given id as value.- Parameters:
id- The ID of the guild. May benullfor a private channel.- Returns:
- The created tag.
-
from
Creates a tag with the given id as value.- Parameters:
id- The ID of the guild. May be empty for a private channel.- 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. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-