Record Class CommandTreeCompiler.MappingCommand

java.lang.Object
java.lang.Record
com.ultikits.ultitools.command.engine.CommandTreeCompiler.MappingCommand
All Implemented Interfaces:
com.mojang.brigadier.Command<io.papermc.paper.command.brigadier.CommandSourceStack>
Enclosing class:
CommandTreeCompiler

static record CommandTreeCompiler.MappingCommand(Method method, List<CommandTreeCompiler.Spec> path, String empty, CommandTreeCompiler.Invocation invocation) extends Record implements com.mojang.brigadier.Command<io.papermc.paper.command.brigadier.CommandSourceStack>
  • Field Details

    • method

      private final Method method
      The field for the method record component.
    • path

      private final List<CommandTreeCompiler.Spec> path
      The field for the path record component.
    • empty

      private final String empty
      The field for the empty record component.
    • invocation

      private final CommandTreeCompiler.Invocation invocation
      The field for the invocation record component.
  • Constructor Details

    • MappingCommand

      MappingCommand(Method method, List<CommandTreeCompiler.Spec> path, String empty, CommandTreeCompiler.Invocation invocation)
      Creates an instance of a MappingCommand record class.
      Parameters:
      method - the value for the method record component
      path - the value for the path record component
      empty - the value for the empty record component
      invocation - the value for the invocation record component
  • Method Details

    • run

      public int run(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Specified by:
      run in interface com.mojang.brigadier.Command<io.papermc.paper.command.brigadier.CommandSourceStack>
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • 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.
    • method

      public Method method()
      Returns the value of the method record component.
      Returns:
      the value of the method record component
    • path

      Returns the value of the path record component.
      Returns:
      the value of the path record component
    • empty

      public String empty()
      Returns the value of the empty record component.
      Returns:
      the value of the empty record component
    • invocation

      public CommandTreeCompiler.Invocation invocation()
      Returns the value of the invocation record component.
      Returns:
      the value of the invocation record component