Class HelpEntry<S extends Source>

java.lang.Object
studio.mevera.imperat.command.tree.help.HelpEntry<S>
Type Parameters:
S - The type of Source from which the command was executed.

public final class HelpEntry<S extends Source> extends Object
Represents a final, immutable entry for a single executable command in the help system.

This class encapsulates a ParameterNode that represents an executable command, along with its corresponding CommandUsage pathway. It ensures that only executable nodes can be used to create a help entry, making it a reliable data model for displaying help information.

  • Method Details

    • getPathway

      @NotNull public @NotNull CommandUsage<S> getPathway()
      Retrieves the command usage pathway associated with this help entry.
      Returns:
      The pathway of the command.
    • getNode

      public ParameterNode<S,?> getNode()
      Retrieves the parameter node associated with this help entry.
      Returns:
      The parameter node.
    • equals

      public boolean equals(Object object)
      Compares this HelpEntry to another object for equality.

      Two help entries are considered equal if their underlying parameter nodes are equal.

      Overrides:
      equals in class Object
      Parameters:
      object - The object to compare with.
      Returns:
      true if the objects are equal, false otherwise.
    • hashCode

      public int hashCode()
      Computes the hash code for this HelpEntry based on its parameter node.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.