Record Class CompiledCommand

java.lang.Object
java.lang.Record
com.ultikits.ultitools.command.engine.CompiledCommand
Record Components:
label - the primary root name
aliases - the additional labels
description - the help description, or null
tree - the real command tree
signature - the canonical structure and visibility signature

public record CompiledCommand(String label, List<String> aliases, @Nullable String description, com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> tree, String signature) extends Record
A tree together with its immutable registration metadata.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final List<String>
    The field for the aliases record component.
    private final @Nullable String
    The field for the description record component.
    private final String
    The field for the label record component.
    private final String
    The field for the signature record component.
    private final com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack>
    The field for the tree record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CompiledCommand(String label, List<String> aliases, @Nullable String description, com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> tree, String signature)
    Copies the alias collection so callers cannot change a registration.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the aliases record component.
    @Nullable String
    Returns the value of the description record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the label record component.
    Returns the value of the signature record component.
    final String
    Returns a string representation of this record class.
    com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack>
    Returns the value of the tree record component.

    Methods inherited from class Object

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

    • label

      private final String label
      The field for the label record component.
    • aliases

      private final List<String> aliases
      The field for the aliases record component.
    • description

      @Nullable private final @Nullable String description
      The field for the description record component.
    • tree

      private final com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> tree
      The field for the tree record component.
    • signature

      private final String signature
      The field for the signature record component.
  • Constructor Details

    • CompiledCommand

      public CompiledCommand(String label, List<String> aliases, @Nullable @Nullable String description, com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> tree, String signature)
      Copies the alias collection so callers cannot change a registration.
  • 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.
    • label

      public String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • aliases

      public List<String> aliases()
      Returns the value of the aliases record component.
      Returns:
      the value of the aliases record component
    • description

      @Nullable public @Nullable String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • tree

      public com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> tree()
      Returns the value of the tree record component.
      Returns:
      the value of the tree record component
    • signature

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