Record Class LinkManager.Link
java.lang.Object
java.lang.Record
com.zetaplugins.serverlinksz.util.LinkManager.Link
- Enclosing class:
LinkManager
public static record LinkManager.Link(String id, String name, String url, boolean allowCommand, ServerLinksZ plugin)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionLink(String id, String name, String url, boolean allowCommand, ServerLinksZ plugin) Creates an instance of aLinkrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallowCommandrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull org.bukkit.command.CommandGet a BukkitCommand for a linkfinal inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.name()Returns the value of thenamerecord component.plugin()Returns the value of thepluginrecord component.final StringtoString()Returns a string representation of this record class.url()Returns the value of theurlrecord component.
-
Constructor Details
-
Link
Creates an instance of aLinkrecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componenturl- the value for theurlrecord componentallowCommand- the value for theallowCommandrecord componentplugin- the value for thepluginrecord component
-
-
Method Details
-
getCommand
@NotNull public @NotNull org.bukkit.command.Command getCommand()Get a BukkitCommand for a link- Returns:
- The BukkitCommand
-
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 '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
url
Returns the value of theurlrecord component.- Returns:
- the value of the
urlrecord component
-
allowCommand
public boolean allowCommand()Returns the value of theallowCommandrecord component.- Returns:
- the value of the
allowCommandrecord component
-
plugin
Returns the value of thepluginrecord component.- Returns:
- the value of the
pluginrecord component
-