-
-
Notifications
You must be signed in to change notification settings - Fork 57
Annotated default-returning methods #667
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request