public static SetHostModeResponse checkSetHostModeResponse(SetHostModeResponse setHostModeResponse) throws RpcException {
  logger.info("Checking {}",setHostModeResponse);
switch (setHostModeResponse.getResult()) {
case OK:
    break;
case SYSTEM_ERROR:
  throw new SystemErrorException(setHostModeResponse.getError());
default :
throw new RpcException(String.format("Unknown result: %s",setHostModeResponse.getResult()));
}
return setHostModeResponse;
}

public static SetHostModeResponse checkSetHostModeResponse ( SetHostModeResponse setHostModeResponse ) throws RpcException { logger . info ( "Checking {}" , setHostModeResponse ) ; switch ( setHostModeResponse . getResult ( ) ) { case OK : break ; case SYSTEM_ERROR : throw new SystemErrorException ( setHostModeResponse . getError ( ) ) ; default : throw new RpcException ( String . format ( "Unknown result: %s" , setHostModeResponse . getResult ( ) ) ) ; } return setHostModeResponse ; }
this method validates a sethostmoderesponse object , raising an exception if the response reflects an operation failure .
