Package commandManagers.commands
Class UpdateId
java.lang.Object
commandManagers.Command
commandManagers.commands.UpdateId
- All Implemented Interfaces:
CommandInterface
Command to update a city by its id number.
-
Constructor Summary
ConstructorsConstructorDescriptionUpdateId()Default constructor from 1.0UpdateId(ModeManager<City> modeManager) Provides choosing handler -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckArgument(Object inputArgument) Checks if the input argument is valid for the UpdateId command.voidexecute()Executes the UpdateId command by updating a city with a specified id number in the collection.getDescr()Base method for show command description.getName()Base method for show command nameMethods inherited from class commandManagers.Command
getArgument, isHasArgument, setArgument
-
Constructor Details
-
UpdateId
public UpdateId()Default constructor from 1.0 -
UpdateId
Provides choosing handler- Parameters:
modeManager- ModuleHandler for operating- Since:
- 1.1
-
-
Method Details
-
getName
Description copied from class:CommandBase method for show command name- Specified by:
getNamein interfaceCommandInterface- Specified by:
getNamein classCommand- Returns:
- command name
-
getDescr
Description copied from class:CommandBase method for show command description.- Specified by:
getDescrin interfaceCommandInterface- Specified by:
getDescrin classCommand- Returns:
- command description
-
execute
Executes the UpdateId command by updating a city with a specified id number in the collection. The method calls the checkArgument method to validate the input argument before execution.- Specified by:
executein interfaceCommandInterface- Specified by:
executein classCommand- Throws:
BuildObjectException
-
checkArgument
Checks if the input argument is valid for the UpdateId command. The input argument should be a non-null string that can be parsed to an integer.- Specified by:
checkArgumentin interfaceCommandInterface- Specified by:
checkArgumentin classCommand- Parameters:
inputArgument- the input argument to be checked- Returns:
- true if the input argument is valid, false otherwise
-