Record Class SuggestionInfo<CommandSender>

java.lang.Object
java.lang.Record
dev.jorel.commandapi.SuggestionInfo<CommandSender>
Record Components:
sender - - the CommandSender typing this command
previousArgs - - a CommandArguments object holding previously declared (and parsed) arguments. This can be used as if it were arguments in a command executor method
currentInput - - a string representing the full current input (including /)
currentArg - - the current partially typed argument. For example "/mycmd tes" will return "tes"

public record SuggestionInfo<CommandSender>(CommandSender sender, CommandArguments previousArgs, String currentInput, String currentArg) extends Record
A class that represents information which you can use to generate suggestions.
  • Constructor Details

    • SuggestionInfo

      public SuggestionInfo(CommandSender sender, CommandArguments previousArgs, String currentInput, String currentArg)
      Creates an instance of a SuggestionInfo record class.
      Parameters:
      sender - the value for the sender record component
      previousArgs - the value for the previousArgs record component
      currentInput - the value for the currentInput record component
      currentArg - the value for the currentArg record component
  • Method Details

    • 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.
    • sender

      public CommandSender sender()
      Returns the value of the sender record component.
      Returns:
      the value of the sender record component
    • previousArgs

      public CommandArguments previousArgs()
      Returns the value of the previousArgs record component.
      Returns:
      the value of the previousArgs record component
    • currentInput

      public String currentInput()
      Returns the value of the currentInput record component.
      Returns:
      the value of the currentInput record component
    • currentArg

      public String currentArg()
      Returns the value of the currentArg record component.
      Returns:
      the value of the currentArg record component