Record Class CooldownType
java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.server.cooldown.CooldownType
public record CooldownType(net.kyori.adventure.key.Key id, long defaultDuration, TimeUnit defaultUnit, CooldownPolicy defaultPolicy)
extends Record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCooldownType(net.kyori.adventure.key.Key id, long defaultDuration, TimeUnit defaultUnit) CooldownType(net.kyori.adventure.key.Key id, long defaultDuration, TimeUnit defaultUnit, CooldownPolicy defaultPolicy) Creates an instance of aCooldownTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thedefaultDurationrecord component.Returns the value of thedefaultPolicyrecord component.Returns the value of thedefaultUnitrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.kyori.adventure.key.Keyid()Returns the value of theidrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
CooldownType
-
CooldownType
public CooldownType(net.kyori.adventure.key.Key id, long defaultDuration, TimeUnit defaultUnit, CooldownPolicy defaultPolicy) Creates an instance of aCooldownTyperecord class.- Parameters:
id- the value for theidrecord componentdefaultDuration- the value for thedefaultDurationrecord componentdefaultUnit- the value for thedefaultUnitrecord componentdefaultPolicy- the value for thedefaultPolicyrecord component
-
-
Method Details
-
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 thecomparemethod from their corresponding wrapper classes. -
id
public net.kyori.adventure.key.Key id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
defaultDuration
public long defaultDuration()Returns the value of thedefaultDurationrecord component.- Returns:
- the value of the
defaultDurationrecord component
-
defaultUnit
Returns the value of thedefaultUnitrecord component.- Returns:
- the value of the
defaultUnitrecord component
-
defaultPolicy
Returns the value of thedefaultPolicyrecord component.- Returns:
- the value of the
defaultPolicyrecord component
-