From 61fd71f69e080790da722e0e03b71ecd7c2538a2 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Tue, 10 May 2016 16:02:45 -0400 Subject: General update --- .../src/main/java/bjc/utils/cli/GenericCommand.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java') 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); } -- cgit v1.2.3