Create Arguments, which can be a class that hold parameter data rather than having to inline them in methods. #41

Open
opened 2019-02-21 10:03:05 +00:00 by Ghost · 0 comments
Ghost commented 2019-02-21 10:03:05 +00:00 (Migrated from codeberg.org)

Instead of this:

public class OsuModule {

    public String getCommand(@Param("help") @Min(8) @Max(16) String username, @Param("help") Mode mode) {

    }
}

We should be allowed to do this:

public class OsuGetArguments {
    
    @Param("help")
    @Min(8)
    @Max(16)
    private String username;

    @Param("help")
    private Mode mode;

    // getters and setters
}
public class OsuModule {

    public String getCommand(OsuArguments args) {

    }
}

This could immensely clean up methods for people using Annotation based configuration.

Instead of **this**: ```java public class OsuModule { public String getCommand(@Param("help") @Min(8) @Max(16) String username, @Param("help") Mode mode) { } } ``` We should be allowed to do **this:** ```java public class OsuGetArguments { @Param("help") @Min(8) @Max(16) private String username; @Param("help") private Mode mode; // getters and setters } ``` ```java public class OsuModule { public String getCommand(OsuArguments args) { } } ``` This could immensely clean up methods for people using Annotation based configuration.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
SethFalco/commandler#41
No description provided.