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;
case 'page':
commandType = CommandType.page;
break;
case 'stateful':
commandType = CommandType.stateful;
break;
case 'stateless':
commandType = CommandType.stateless;
break;
default:
throw UnsupportedError('Invalid command name.');
}
return commandType;
}