Record Class Kit
java.lang.Object
java.lang.Record
fr.mathildeuh.youneedme.api.kits.Kit
public record Kit(String id, String displayName, List<org.bukkit.inventory.ItemStack> items, @Nullable String permission, long cooldownSeconds, boolean oneTime, @Nullable Integer maxClaims)
extends Record
A kit definition. Kits are configuration, not player data (see
modules/kits.yml), but
still modeled here so expansions can register additional kits programmatically (a "new kit type",
e.g. one generated from a template) without touching YAML.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecooldownSecondsrecord component.Returns the value of thedisplayNamerecord component.final booleanIndicates whether some other object is "equal to" this one.booleanfinal inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.List<org.bukkit.inventory.ItemStack> items()Returns the value of theitemsrecord component.@Nullable IntegerReturns the value of themaxClaimsrecord component.booleanoneTime()Returns the value of theoneTimerecord component.@Nullable StringReturns the value of thepermissionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Kit
public Kit(String id, String displayName, List<org.bukkit.inventory.ItemStack> items, @Nullable @Nullable String permission, long cooldownSeconds, boolean oneTime, @Nullable @Nullable Integer maxClaims) Creates an instance of aKitrecord class.- Parameters:
id- the value for theidrecord componentdisplayName- the value for thedisplayNamerecord componentitems- the value for theitemsrecord componentpermission- the value for thepermissionrecord componentcooldownSeconds- the value for thecooldownSecondsrecord componentoneTime- the value for theoneTimerecord componentmaxClaims- the value for themaxClaimsrecord component
-
-
Method Details
-
hasCooldown
public boolean hasCooldown() -
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
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
displayName
Returns the value of thedisplayNamerecord component.- Returns:
- the value of the
displayNamerecord component
-
items
Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-
permission
Returns the value of thepermissionrecord component.- Returns:
- the value of the
permissionrecord component
-
cooldownSeconds
public long cooldownSeconds()Returns the value of thecooldownSecondsrecord component.- Returns:
- the value of the
cooldownSecondsrecord component
-
oneTime
public boolean oneTime()Returns the value of theoneTimerecord component.- Returns:
- the value of the
oneTimerecord component
-
maxClaims
Returns the value of themaxClaimsrecord component.- Returns:
- the value of the
maxClaimsrecord component
-