From 5cf7bcf156970fe72f79e40b8a6e320ea160ac83 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Fri, 21 Oct 2016 14:14:48 -0400 Subject: Documentation --- .../src/main/java/bjc/utils/cli/GenericCommand.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 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 e73d936..54d2fa0 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java +++ b/BJC-Utils2/src/main/java/bjc/utils/cli/GenericCommand.java @@ -1,5 +1,7 @@ package bjc.utils.cli; +import org.eclipse.jdt.annotation.Nullable; + /** * Generic command implementation * @@ -18,19 +20,24 @@ public class GenericCommand implements ICommand { * @param handler * The handler to use for the command * @param description - * The description of the command + * The description of the command. May be null * @param help - * The detailed help message for the command + * The detailed help message for the command. May be null */ - public GenericCommand(ICommandHandler handler, String description, - String help) { + public GenericCommand(ICommandHandler handler, @Nullable String description, + @Nullable String help) { if (handler == null) { throw new NullPointerException( "Command handler must not be null"); } this.handler = handler; - this.help = new GenericHelp(description, help); + + if (description == null) { + this.help = new NullHelp(); + } else { + this.help = new GenericHelp(description, help); + } } @Override -- cgit v1.2.3