keith-turner commented on a change in pull request #1083: [WIP] POC for Command
module with centralized Command Pattern logic
URL: https://github.com/apache/fluo/pull/1083#discussion_r364837763
##########
File path:
modules/command/src/main/java/org/apache/fluo/command/AppCommand.java
##########
@@ -16,19 +16,25 @@
package org.apache.fluo.command;
import com.beust.jcommander.Parameter;
+import org.apache.fluo.api.config.FluoConfiguration;
-class CommonOpts extends ConfigOpts {
+abstract class AppCommand extends ConfigCommand {
@Parameter(names = "-a", required = true, description = "Fluo application
name")
private String applicationName;
+ @Override
+ FluoConfiguration getConfig() {
+ FluoConfiguration config = super.getConfig();
+ config.setApplicationName(applicationName);
+ return config;
+ }
+
String getApplicationName() {
return applicationName;
}
- public static CommonOpts parse(String programName, String[] args) {
- CommonOpts opts = new CommonOpts();
- parse(programName, opts, args);
- return opts;
+ void setApplicationName(String applicationName) {
Review comment:
If this is only meant for test, could add `@VisibleForTesting` annotation.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services