Class Command<A>
java.lang.Object
uk.ac.manchester.spinnaker.nmpi.machinemanager.commands.Command<A>
- Type Parameters:
A
- The type of arguments.
- Direct Known Subclasses:
CreateJobCommand
,DestroyJobCommand
,GetJobMachineInfoCommand
,GetJobStateCommand
,JobKeepAliveCommand
,ListMachinesCommand
,NoNotifyJobCommand
,NotifyJobCommand
,PowerOffJobBoardsCommand
,PowerOnJobBoardsCommand
,WhereIsCommand
public abstract class Command<A> extends Object
A serialisable request to spalloc.
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description protected void
addArg(A... values)
Add to the positional arguments part.protected void
addKwArg(String key, Object value)
Add to the keyword arguments part.List<A>
getArgs()
Get the command arguments.String
getCommand()
Get the command name.Map<String,Object>
getKwargs()
Get the command keyword arguments.
-
Constructor Details
-
Command
Create a command.- Parameters:
command
- The command token.
-
-
Method Details
-
addKwArg
Add to the keyword arguments part.- Parameters:
key
- The keywordvalue
- The argument value; will be converted to a string
-
addArg
Add to the positional arguments part.- Parameters:
values
- The arguments to add.
-
getCommand
Get the command name.- Returns:
- The command name
-
getArgs
Get the command arguments.- Returns:
- The command arguments.
-
getKwargs
Get the command keyword arguments.- Returns:
- The command keyword arguments
-