diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-05-10 16:02:45 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-05-10 16:02:45 -0400 |
| commit | 61fd71f69e080790da722e0e03b71ecd7c2538a2 (patch) | |
| tree | e5c1150b27b84d550f807e44ac82688216451f00 /BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java | |
| parent | 87ae1dfc8d8cb7b51d7bda4750ce841bbe691cfc (diff) | |
General update
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java b/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java index 529635d..1a95018 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java +++ b/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java @@ -7,7 +7,9 @@ package bjc.utils.cli; * */ public class GenericCommand implements ICommand { + // The behavior for invoking the command private ICommandHandler handler; + // The help for the command private ICommandHelp help; /** @@ -22,17 +24,16 @@ public class GenericCommand implements ICommand { */ public GenericCommand(ICommandHandler handler, String description, String help) { + if(handler == null) { + throw new NullPointerException("Command handler must not be null"); + } + this.handler = handler; this.help = new GenericHelp(description, help); } - - /** - * Create a command that is an alias to this one - * - * @return A command that is an alias to this one - */ + @Override - public ICommand createAlias() { + public ICommand aliased() { return new DelegatingCommand(this); } |
