from function
Parses an String name
into an CommandType
throws Exception if an invalid string was passed
Implementation
CommandType from(final String name) {
CommandType commandType;
switch (name) {
case 'model':
commandType = CommandType.model;
break;
default:
throw Exception('Invalid command name.');
}
return commandType;
}