Record Class Argument<C extends CommandContext<C>, V>
java.lang.Object
java.lang.Record
site.lab0x13.scrow.commands.model.argument.Argument<C,V>
- Type Parameters:
C- argument of command contextV- argument of argument value
public record Argument<C extends CommandContext<C>, V>(String id, ArgumentType<C extends CommandContext<C>, V> type, List<ArgumentRequirement<C extends CommandContext<C>, V>> requirements, SuggestionProvider<C extends CommandContext<C>> suggestionProvider, DefaultValueProvider<C extends CommandContext<C>, V> defaultValueProvider)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionArgument(String id, ArgumentType<C, V> type, List<ArgumentRequirement<C, V>> requirements, SuggestionProvider<C> suggestionProvider, DefaultValueProvider<C, V> defaultValueProvider) Creates an instance of aArgumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <C extends CommandContext<C>, V>
ArgumentBuilder<C, V> builder(String id, ArgumentType<C, V> type) Returns the value of thedefaultValueProviderrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.com.leakyabstractions.result.api.Result<ParsedArgument<C, V>, String> Returns the value of therequirementsrecord component.Returns the value of thesuggestionProviderrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Argument
public Argument(String id, ArgumentType<C, V> type, List<ArgumentRequirement<C, V>> requirements, SuggestionProvider<C> suggestionProvider, DefaultValueProvider<C, V> defaultValueProvider) Creates an instance of aArgumentrecord class.- Parameters:
id- the value for theidrecord componenttype- the value for thetyperecord componentrequirements- the value for therequirementsrecord componentsuggestionProvider- the value for thesuggestionProviderrecord componentdefaultValueProvider- the value for thedefaultValueProviderrecord component
-
-
Method Details
-
builder
public static <C extends CommandContext<C>, V> ArgumentBuilder<C,V> builder(String id, ArgumentType<C, V> type) -
parse
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
requirements
Returns the value of therequirementsrecord component.- Returns:
- the value of the
requirementsrecord component
-
suggestionProvider
Returns the value of thesuggestionProviderrecord component.- Returns:
- the value of the
suggestionProviderrecord component
-
defaultValueProvider
Returns the value of thedefaultValueProviderrecord component.- Returns:
- the value of the
defaultValueProviderrecord component
-