Package dev.jorel.commandapi.arguments
Class MapArgumentBuilder.MapArgumentBuilderValueMapper.MapArgumentBuilderSuggestsKey.MapArgumentBuilderSuggestsValue
java.lang.Object
dev.jorel.commandapi.arguments.MapArgumentBuilder.MapArgumentBuilderValueMapper.MapArgumentBuilderSuggestsKey.MapArgumentBuilderSuggestsValue
public class MapArgumentBuilder.MapArgumentBuilderValueMapper.MapArgumentBuilderSuggestsKey.MapArgumentBuilderSuggestsValue
extends Object
An intermediary class for the
MapArgumentBuilder-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMapArgumentBuilder<K,V>.MapArgumentBuilderValueMapper.MapArgumentBuilderSuggestsKey.MapArgumentBuilderSuggestsValue.MapArgumentBuilderFinished When using this method, no value suggestions are displayed and any values can be given for the final map.MapArgumentBuilder<K,V>.MapArgumentBuilderValueMapper.MapArgumentBuilderSuggestsKey.MapArgumentBuilderSuggestsValue.MapArgumentBuilderFinished withoutValueList(boolean allowDuplicates) When using this method, no value suggestions are displayed and any values can be given for the final map.MapArgumentBuilder<K,V>.MapArgumentBuilderValueMapper.MapArgumentBuilderSuggestsKey.MapArgumentBuilderSuggestsValue.MapArgumentBuilderFinished withValueList(List<String> valueList) Provides a list of values to suggest when a user types this argument.MapArgumentBuilder<K,V>.MapArgumentBuilderValueMapper.MapArgumentBuilderSuggestsKey.MapArgumentBuilderSuggestsValue.MapArgumentBuilderFinished withValueList(List<String> valueList, boolean allowDuplicates) Provides a list of values to suggest when a user types this argument.
-
Constructor Details
-
MapArgumentBuilderSuggestsValue
-
-
Method Details
-
withValueList
public MapArgumentBuilder<K,V>.MapArgumentBuilderValueMapper.MapArgumentBuilderSuggestsKey.MapArgumentBuilderSuggestsValue.MapArgumentBuilderFinished withValueList(List<String> valueList) Provides a list of values to suggest when a user types this argument. All values given for the final map must come from this list, otherwise a CommandSyntaxException is thrown.Additionally, duplicate values are not allowed. If a duplicate value is given, a CommandSyntaxException is thrown. To allow duplicate values, use the
withValueList(List, boolean)method instead.- Parameters:
valueList- A list of values to suggest. The values need to be Strings, so they can be suggested- Returns:
- this map argument builder
-
withValueList
public MapArgumentBuilder<K,V>.MapArgumentBuilderValueMapper.MapArgumentBuilderSuggestsKey.MapArgumentBuilderSuggestsValue.MapArgumentBuilderFinished withValueList(List<String> valueList, boolean allowDuplicates) Provides a list of values to suggest when a user types this argument. All values given for the final map must come from this list, otherwise a CommandSyntaxException is thrown.If allowDuplicates is true, then multiple keys may be given the same value. Otherwise, if a duplicate value is given, a CommandSyntaxException is thrown.
- Parameters:
valueList- A list of values to suggest. The values need to be Strings, so they can be suggestedallowDuplicates- Decides if a value can be written more than once- Returns:
- this map argument builder
-
withoutValueList
public MapArgumentBuilder<K,V>.MapArgumentBuilderValueMapper.MapArgumentBuilderSuggestsKey.MapArgumentBuilderSuggestsValue.MapArgumentBuilderFinished withoutValueList()When using this method, no value suggestions are displayed and any values can be given for the final map. To restrict the values that can be given for this map, usewithValueList(List)instead.Additionally, duplicate values are not allowed. If a duplicate value is given, a CommandSyntaxException is thrown. To allow duplicate values, use the
withoutValueList(boolean)method instead.- Returns:
- this map argument builder
-
withoutValueList
public MapArgumentBuilder<K,V>.MapArgumentBuilderValueMapper.MapArgumentBuilderSuggestsKey.MapArgumentBuilderSuggestsValue.MapArgumentBuilderFinished withoutValueList(boolean allowDuplicates) When using this method, no value suggestions are displayed and any values can be given for the final map. To restrict the values that can be given for this map, usewithValueList(List, boolean)instead.If allowDuplicates is true, then multiple keys may be given the same value. Otherwise, if a duplicate value is given, a CommandSyntaxException is thrown.
- Parameters:
allowDuplicates- Decides if a value can be written more than once- Returns:
- this map argument builder
-