Record Class TabCompleteContext

java.lang.Object
java.lang.Record
com.marcusslover.plus.lib.command.TabCompleteContext
All Implemented Interfaces:
ICommandContextHelper<TabCompleteContext>

public record TabCompleteContext(@NotNull Command commandData, @NotNull org.bukkit.command.CommandSender sender, @NotNull String label, @NotNull String alias, @NotNull String[] args) extends Record implements ICommandContextHelper<TabCompleteContext>
  • Constructor Summary

    Constructors
    Constructor
    Description
    TabCompleteContext(@NotNull Command commandData, @NotNull org.bukkit.command.CommandSender sender, @NotNull String label, @NotNull String alias, @NotNull String[] args)
    Creates an instance of a TabCompleteContext record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    Returns the value of the alias record component.
    @NotNull String[]
    Returns the value of the args record component.
    asConsole(@NotNull Consumer<@NotNull org.bukkit.command.ConsoleCommandSender> console)
     
    asPlayer(@NotNull Consumer<@NotNull org.bukkit.entity.Player> player)
     
    @NotNull Command
    Returns the value of the commandData record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull String
    Returns the value of the label record component.
    @NotNull org.bukkit.command.CommandSender
    Returns the value of the sender record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TabCompleteContext

      public TabCompleteContext(@NotNull @NotNull Command commandData, @NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String label, @NotNull @NotNull String alias, @NotNull @NotNull String[] args)
      Creates an instance of a TabCompleteContext record class.
      Parameters:
      commandData - the value for the commandData record component
      sender - the value for the sender record component
      label - the value for the label record component
      alias - the value for the alias record component
      args - the value for the args record component
  • Method Details

    • asPlayer

      @NotNull public @NotNull TabCompleteContext asPlayer(@NotNull @NotNull Consumer<@NotNull org.bukkit.entity.Player> player)
      Specified by:
      asPlayer in interface ICommandContextHelper<TabCompleteContext>
    • asConsole

      @NotNull public @NotNull TabCompleteContext asConsole(@NotNull @NotNull Consumer<@NotNull org.bukkit.command.ConsoleCommandSender> console)
      Specified by:
      asConsole in interface ICommandContextHelper<TabCompleteContext>
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • commandData

      @NotNull public @NotNull Command commandData()
      Returns the value of the commandData record component.
      Returns:
      the value of the commandData record component
    • sender

      @NotNull public @NotNull org.bukkit.command.CommandSender sender()
      Returns the value of the sender record component.
      Returns:
      the value of the sender record component
    • label

      @NotNull public @NotNull String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • alias

      @NotNull public @NotNull String alias()
      Returns the value of the alias record component.
      Returns:
      the value of the alias record component
    • args

      @NotNull public @NotNull String[] args()
      Returns the value of the args record component.
      Returns:
      the value of the args record component