Class AbstractConsoleCommandExtension
java.lang.Object
org.openhab.core.io.console.extensions.AbstractConsoleCommandExtension
- All Implemented Interfaces:
- ConsoleCommandExtension
- Direct Known Subclasses:
- ScriptEngineConsoleCommandExtension
@NonNullByDefault
public abstract class AbstractConsoleCommandExtension
extends Object
implements ConsoleCommandExtension
A base class that should be used by console command extension for better inclusion.
- Author:
- Markus Rathgeb - Initial contribution
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractConsoleCommandExtension(String cmd, String desc) Generate a new console command extension.
- 
Method SummaryModifier and TypeMethodDescriptionprotected StringbuildCommandUsage(String description) Build a command usage string.protected StringbuildCommandUsage(String syntax, String description) Build a command usage string.Get the command of for the extension.Get the description for the extension.protected voidprintUsage(Console console) Print the whole usages to the console.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openhab.core.io.console.extensions.ConsoleCommandExtensionexecute, getCompleter, getUsages
- 
Constructor Details- 
AbstractConsoleCommandExtensionGenerate a new console command extension.- Parameters:
- cmd- The command the extension is used for.
- desc- The description what this extension is handling.
 
 
- 
- 
Method Details- 
getCommandDescription copied from interface:ConsoleCommandExtensionGet the command of for the extension.- Specified by:
- getCommandin interface- ConsoleCommandExtension
- Returns:
- command for the extension
 
- 
getDescriptionDescription copied from interface:ConsoleCommandExtensionGet the description for the extension.- Specified by:
- getDescriptionin interface- ConsoleCommandExtension
- Returns:
- description for the extension
 
- 
buildCommandUsageBuild a command usage string. You should always use that function to use a usage string that complies to a standard format.- Parameters:
- description- the description of the command
- Returns:
- a usage string that complies to a standard format
 
- 
buildCommandUsageBuild a command usage string. You should always use that function to use a usage string that complies to a standard format.- Parameters:
- syntax- the syntax format
- description- the description of the command
- Returns:
- a usage string that complies to a standard format
 
- 
printUsagePrint the whole usages to the console.- Parameters:
- console- the console that should be used for output
 
 
-