Record Class PaperExecutionSource
java.lang.Object
java.lang.Record
io.github.projectunified.craftcommand.processor.paper.PaperExecutionSource
- Record Components:
processor- the owning Paper generatornodes- the Brigadier nodes in argument orderparsedNodeCount- 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 Summary
ConstructorsConstructorDescriptionPaperExecutionSource(PaperCommandGenerator processor, List<io.github.projectunified.craftcommand.processor.paper.PaperCommandGenerator.NodeInfo> nodes, int parsedNodeCount) Creates an instance of aPaperExecutionSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidgenerateExecution(com.palantir.javapoet.MethodSpec.Builder methodSpec, CommandModel classModel, MethodModel method, String instanceExpr, CommandModel rootModel) Emits the execution body for one method.final inthashCode()Returns a hash code value for this object.List<io.github.projectunified.craftcommand.processor.paper.PaperCommandGenerator.NodeInfo> nodes()Returns the value of thenodesrecord component.intReturns the value of theparsedNodeCountrecord component.Returns the value of theprocessorrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PaperExecutionSource
public PaperExecutionSource(PaperCommandGenerator processor, List<io.github.projectunified.craftcommand.processor.paper.PaperCommandGenerator.NodeInfo> nodes, int parsedNodeCount) Creates an instance of aPaperExecutionSourcerecord class.- Parameters:
processor- the value for theprocessorrecord componentnodes- the value for thenodesrecord componentparsedNodeCount- the value for theparsedNodeCountrecord 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 methodclassModel- the command class being generatedmethod- the command method to executeinstanceExpr- the command instance expressionrootModel- the root command model
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
processor
Returns the value of theprocessorrecord component.- Returns:
- the value of the
processorrecord component
-
nodes
public List<io.github.projectunified.craftcommand.processor.paper.PaperCommandGenerator.NodeInfo> nodes()Returns the value of thenodesrecord component.- Returns:
- the value of the
nodesrecord component
-
parsedNodeCount
public int parsedNodeCount()Returns the value of theparsedNodeCountrecord component.- Returns:
- the value of the
parsedNodeCountrecord component
-