Record Class CommandArgumentSpecImpl<T,V>
java.lang.Object
java.lang.Record
de.kentoj.kencommandapi.api.argument.CommandArgumentSpecImpl<T,V>
- All Implemented Interfaces:
CommandArgumentSpec<T,V>
public record CommandArgumentSpecImpl<T,V> (String id, ArgumentType<T,V> type, List<ArgumentRequirement<V>> requirements, Function<CommandContext<T>, V> defaultValueProvider, @Nullable SuggestionProvider<T> suggestionProvider)
extends Record
implements CommandArgumentSpec<T,V>
-
Constructor Summary
ConstructorsConstructorDescriptionCommandArgumentSpecImpl(String id, ArgumentType<T, V> type, List<ArgumentRequirement<V>> requirements, Function<CommandContext<T>, V> defaultValueProvider, @Nullable SuggestionProvider<T> suggestionProvider) Creates an instance of aCommandArgumentSpecImplrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Function<CommandContext<T>, V> 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.parseInput(String rawInput) Returns the value of therequirementsrecord component.@NotNull SuggestionProvider<T> 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
-
CommandArgumentSpecImpl
public CommandArgumentSpecImpl(String id, ArgumentType<T, V> type, List<ArgumentRequirement<V>> requirements, Function<CommandContext<T>, V> defaultValueProvider, @Nullable @Nullable SuggestionProvider<T> suggestionProvider) Creates an instance of aCommandArgumentSpecImplrecord class.- Parameters:
id- the value for theidrecord componenttype- the value for thetyperecord componentrequirements- the value for therequirementsrecord componentdefaultValueProvider- the value for thedefaultValueProviderrecord componentsuggestionProvider- the value for thesuggestionProviderrecord component
-
-
Method Details
-
parseInput
- Specified by:
parseInputin interfaceCommandArgumentSpec<T,V>
-
defaultValueProvider
Returns the value of thedefaultValueProviderrecord component.- Specified by:
defaultValueProviderin interfaceCommandArgumentSpec<T,V> - Returns:
- the value of the
defaultValueProviderrecord component
-
suggestionProvider
Returns the value of thesuggestionProviderrecord component.- Specified by:
suggestionProviderin interfaceCommandArgumentSpec<T,V> - Returns:
- the value of the
suggestionProviderrecord component
-
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.- Specified by:
idin interfaceCommandArgumentSpec<T,V> - Returns:
- the value of the
idrecord component
-
type
Returns the value of thetyperecord component.- Specified by:
typein interfaceCommandArgumentSpec<T,V> - Returns:
- the value of the
typerecord component
-
requirements
Returns the value of therequirementsrecord component.- Returns:
- the value of the
requirementsrecord component
-