Added helper methods for checking availability of classItems:
checkValidNewName - returns true when the proposed new name is not already in use in the HashMap.
checkValidOldName - returns true when the class to be renamed exists in the HashMap
private setClassItemName - private so that we require any name changes go through the condition checking in renameClassItem.
renameClassItem - does basic precondition checking to ensure input is valid (non-null, non-blank strings), then checks validness of class to be renamed, and proposed new name, if both true we rename classItem and display success message. if false, error messages are displayed from helper methods.
Added helper methods for checking availability of classItems:
checkValidNewName
- returns true when the proposed new name is not already in use in the HashMap.checkValidOldName
- returns true when the class to be renamed exists in the HashMapprivate setClassItemName
- private so that we require any name changes go through the condition checking in renameClassItem.renameClassItem
- does basic precondition checking to ensure input is valid (non-null, non-blank strings), then checks validness of class to be renamed, and proposed new name, if both true we rename classItem and display success message. if false, error messages are displayed from helper methods.