Record Class PaperExecutionSource

java.lang.Object
java.lang.Record
io.github.projectunified.craftcommand.processor.paper.PaperExecutionSource
Record Components:
processor - the owning Paper generator
nodes - the Brigadier nodes in argument order
parsedNodeCount - the number of nodes already parsed

public record PaperExecutionSource(PaperCommandGenerator processor, List<io.github.projectunified.craftcommand.processor.paper.PaperCommandGenerator.NodeInfo> nodes, int parsedNodeCount) extends Record
Emits the execution body of one Brigadier node chain: sender resolution, parameter retrieval from the Brigadier context, and the call into the command instance.
  • Constructor Details

    • PaperExecutionSource

      public PaperExecutionSource(PaperCommandGenerator processor, List<io.github.projectunified.craftcommand.processor.paper.PaperCommandGenerator.NodeInfo> nodes, int parsedNodeCount)
      Creates an instance of a PaperExecutionSource record class.
      Parameters:
      processor - the value for the processor record component
      nodes - the value for the nodes record component
      parsedNodeCount - the value for the parsedNodeCount record component
  • Method Details

    • generateExecution

      public void generateExecution(com.palantir.javapoet.MethodSpec.Builder methodSpec, CommandModel classModel, MethodModel method, String instanceExpr, CommandModel rootModel)
      Emits the execution body for one method.
      Parameters:
      methodSpec - the generated method
      classModel - the command class being generated
      method - the command method to execute
      instanceExpr - the command instance expression
      rootModel - the root command model
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • processor

      public PaperCommandGenerator processor()
      Returns the value of the processor record component.
      Returns:
      the value of the processor record component
    • nodes

      public List<io.github.projectunified.craftcommand.processor.paper.PaperCommandGenerator.NodeInfo> nodes()
      Returns the value of the nodes record component.
      Returns:
      the value of the nodes record component
    • parsedNodeCount

      public int parsedNodeCount()
      Returns the value of the parsedNodeCount record component.
      Returns:
      the value of the parsedNodeCount record component