return new FireExtinctedEvent(realMessage.getEmergencyId(), realMessage.getTime());
}else if (message instanceof FireTruckWaterRefilledMessage){
FireTruckWaterRefilledMessage realMessage = (FireTruckWaterRefilledMessage)message;
return new FireTruckWaterRefilledEvent(realMessage.getEmergencyId(), realMessage.getVehicleId(), realMessage.getTime());
}else if (message instanceof HeartBeatMessage){
HeartBeatMessage realMessage = (HeartBeatMessage)message;
PulseEvent event = new PulseEvent((int)realMessage.getHeartBeatValue());
event.setEmergencyId(realMessage.getEmergencyId());
event.setVehicleId(realMessage.getVehicleId());
return event;
}
throw new UnsupportedOperationException("Don't know how to convert "+message+" to CallEvent instance");