Class AbstractCommand
java.lang.Object
org.tasktide.core.manager.command.commands.AbstractCommand
- All Implemented Interfaces:
ManagerCommand
- Direct Known Subclasses:
AnnotateCommand, DeleteCommand, ExportCommand, ImportCommand, ResetCommand, SummarizeCommand
Abstract class to wrap standardize class fields
across manager commands, getters/setters etc, JSON (de)serialization,
wraps the execution process with a validation step. Since
ManagerCommand can be built, and returned as that interface,
this abstract carries a lot of useful foundational work on behalf of
the implementing classes which they all can use, without stepping into
the complexity of them.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ManagerActionprotected final CommandSpecprotected final CommandTypeprotected final ManagerTarget -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCommand(ManagerAction action, ManagerTarget target, CommandSpec cmdSpec, CommandType cmdType) Construct with requriements -
Method Summary
Modifier and TypeMethodDescriptionexecute()Execution is wrapped into the abstract validation, then runCommand callsGet configured action for commandGet command specifications for taskGet target for commandabstract ObjectDefines how a concreteManagerCommandexecutes a validated commandRepresent as JSON documentRepresent as JSON stringtoString()Represent as stringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ManagerCommand
validateCommand
-
Field Details
-
action
-
target
-
cmdSpec
-
cmdType
-
-
Constructor Details
-
AbstractCommand
public AbstractCommand(ManagerAction action, ManagerTarget target, CommandSpec cmdSpec, CommandType cmdType) Construct with requriements- Parameters:
action-target-cmdSpec-cmdType-
-
-
Method Details
-
execute
Execution is wrapped into the abstract validation, then runCommand calls- Specified by:
executein interfaceManagerCommand- Returns:
- boolean
-
runCommand
Defines how a concreteManagerCommandexecutes a validated command- Returns:
- Object
-
getAction
-
getTarget
-
getCmdSpec
-
getCmdType
- Returns:
CommandType
-
toJsonString
Represent as JSON string- Specified by:
toJsonStringin interfaceManagerCommand- Returns:
- String
-
toJsonDoc
Represent as JSON document- Specified by:
toJsonDocin interfaceManagerCommand- Returns:
- String
-
toString
-