Record Class ArgumentMapping
java.lang.Object
java.lang.Record
com.ultikits.ultitools.command.engine.ArgumentMapping
record ArgumentMapping(Class<?> javaType, boolean greedy, com.mojang.brigadier.arguments.ArgumentType<?> type, NativeArgumentTypes nativeTypes)
extends Record
One declared Java parameter and its node's parse/result representation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for thegreedyrecord component.private final Class<?> The field for thejavaTyperecord component.private final NativeArgumentTypesThe field for thenativeTypesrecord component.private final com.mojang.brigadier.arguments.ArgumentType<?> The field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionArgumentMapping(Class<?> javaType, boolean greedy, com.mojang.brigadier.arguments.ArgumentType<?> type, NativeArgumentTypes nativeTypes) Creates an instance of aArgumentMappingrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleangreedy()Returns the value of thegreedyrecord component.final inthashCode()Returns a hash code value for this object.Class<?> javaType()Returns the value of thejavaTyperecord component.private static Objectprivate static com.mojang.brigadier.arguments.ArgumentType<?> narrowPrimitive(Class<?> type) Returns the value of thenativeTypesrecord component.private static com.mojang.brigadier.arguments.ArgumentType<?> (package private) static ArgumentMappingof(Class<?> type, boolean greedy, NativeArgumentTypes nativeTypes) (package private) Stringprivate static com.mojang.brigadier.arguments.ArgumentType<?> single(Class<?> type, NativeArgumentTypes nativeTypes) final StringtoString()Returns a string representation of this record class.com.mojang.brigadier.arguments.ArgumentType<?> type()Returns the value of thetyperecord component.(package private) Objectvalue(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context, String name, boolean empty)
-
Field Details
-
javaType
The field for thejavaTyperecord component. -
greedy
private final boolean greedyThe field for thegreedyrecord component. -
type
private final com.mojang.brigadier.arguments.ArgumentType<?> typeThe field for thetyperecord component. -
nativeTypes
The field for thenativeTypesrecord component.
-
-
Constructor Details
-
ArgumentMapping
ArgumentMapping(Class<?> javaType, boolean greedy, com.mojang.brigadier.arguments.ArgumentType<?> type, NativeArgumentTypes nativeTypes) Creates an instance of aArgumentMappingrecord class.- Parameters:
javaType- the value for thejavaTyperecord componentgreedy- the value for thegreedyrecord componenttype- the value for thetyperecord componentnativeTypes- the value for thenativeTypesrecord component
-
-
Method Details
-
of
-
single
private static com.mojang.brigadier.arguments.ArgumentType<?> single(Class<?> type, NativeArgumentTypes nativeTypes) -
numeric
-
narrowPrimitive
-
value
-
narrow
-
signature
String signature() -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
javaType
Returns the value of thejavaTyperecord component.- Returns:
- the value of the
javaTyperecord component
-
greedy
public boolean greedy()Returns the value of thegreedyrecord component.- Returns:
- the value of the
greedyrecord component
-
type
public com.mojang.brigadier.arguments.ArgumentType<?> type()Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
nativeTypes
Returns the value of thenativeTypesrecord component.- Returns:
- the value of the
nativeTypesrecord component
-