private Location getLocationByType(Event event, LocationType type) { if (event.getLocations() == null) return null; for (Location loc : event.getLocations()) { if (loc.getType() == type) { return loc; } } return null; }