public static CommandImpl getCommand ( final String name , final List < CommandImpl > commandList ) throws DevFailed { CommandImpl result = null ; for ( final CommandImpl command : commandList ) { if ( command . getName ( ) . equalsIgnoreCase ( name ) ) { result = command ; break ; } } if ( result == null ) { throw DevFailedUtils . newDevFailed ( ExceptionMessages . COMMAND_NOT_FOUND , "Command " + name + " not found" ) ; } return result ; }
Get a command