Record Class SlashCommandDefinition.CooldownDefinition
java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.definitions.interactions.command.SlashCommandDefinition.CooldownDefinition
- Record Components:
delay
- the delay of the cooldowntimeUnit
- theTimeUnit
of the specified delay
- All Implemented Interfaces:
Definition
- Enclosing class:
SlashCommandDefinition
public static record SlashCommandDefinition.CooldownDefinition(long delay, TimeUnit timeUnit)
extends Record
implements Definition
Representation of a cooldown definition defined by
Cooldown
.-
Constructor Summary
ConstructorDescriptionCooldownDefinition
(long delay, TimeUnit timeUnit) Creates an instance of aCooldownDefinition
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull SlashCommandDefinition.CooldownDefinition
Builds a newSlashCommandDefinition.CooldownDefinition
from the givenCooldown
annotation.long
delay()
Returns the value of thedelay
record component.@NotNull String
The human-readable name of this definition.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.timeUnit()
Returns the value of thetimeUnit
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.kaktushose.jda.commands.definitions.Definition
definitionId
-
Constructor Details
-
CooldownDefinition
-
-
Method Details
-
build
@NotNull public static @NotNull SlashCommandDefinition.CooldownDefinition build(@Nullable @Nullable Cooldown cooldown) Builds a newSlashCommandDefinition.CooldownDefinition
from the givenCooldown
annotation. -
displayName
Description copied from interface:Definition
The human-readable name of this definition.- Specified by:
displayName
in interfaceDefinition
-
toString
-
hashCode
-
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 thecompare
method from their corresponding wrapper classes. -
delay
-
timeUnit
-