Allow @DefaultValue to apply to methods, in which case the method will produce a default value. Flexible signatures can be supported with the new annotated method system.
This would be merged after #598.
@DefaultValue("name")
public @NonNull ArgumentParseResult<YourValue> defaultValue(
final @NonNull CommandContext<YourSenderType> context
) {
// logic...
return theValue;
}
then in the method, @DefaultValue(provider = "name")
We'd have to make the value of @DefaultValue default to "", which should be fine. We need a small class for housing the name-provider mappings.
Allow
@DefaultValueto apply to methods, in which case the method will produce a default value. Flexible signatures can be supported with the new annotated method system.This would be merged after #598.
then in the method,
@DefaultValue(provider = "name")We'd have to make the value of
@DefaultValuedefault to"", which should be fine. We need a small class for housing the name-provider mappings.