private static ServiceTicketResponse checkGetNfcServiceTicketResponse(ServiceTicketResponse serviceTicketResponse) throws RpcException {
  logger.info("Checking {}",serviceTicketResponse);
switch (serviceTicketResponse.getResult()) {
case OK:
    break;
case SYSTEM_ERROR:
  throw new SystemErrorException(serviceTicketResponse.getError());
case NOT_FOUND:
throw new DatastoreNotFoundException(serviceTicketResponse.getError());
default :
throw new RpcException(String.format("Unknown result: %s",serviceTicketResponse.getError()));
}
return serviceTicketResponse;
}

private static ServiceTicketResponse checkGetNfcServiceTicketResponse ( ServiceTicketResponse serviceTicketResponse ) throws RpcException { logger . info ( "Checking {}" , serviceTicketResponse ) ; switch ( serviceTicketResponse . getResult ( ) ) { case OK : break ; case SYSTEM_ERROR : throw new SystemErrorException ( serviceTicketResponse . getError ( ) ) ; case NOT_FOUND : throw new DatastoreNotFoundException ( serviceTicketResponse . getError ( ) ) ; default : throw new RpcException ( String . format ( "Unknown result: %s" , serviceTicketResponse . getError ( ) ) ) ; } return serviceTicketResponse ; }
this method validates a serviceticketresponse object , raising an exception if the response reflects an operation failure .
