app/controllers/DestinationsController.java
private List<Destination> loadTravellerTypes(List<Destination> destinationsList) {
        for (Destination destination : destinationsList) {
            List<TravellerType> travellerTypes = destinationRepository.getDestinationsTravellerTypes(destination.getDestinationId());
            Map<Integer, TravellerType> travellerTypesMap = new HashMap<>();
            for (TravellerType i : travellerTypes) {
                travellerTypesMap.put(i.getTravellerTypeId(), i);
            }
            destination.setTravellerTypes(travellerTypesMap);
        }
        return destinationsList;
    }
/**
     * Takes in a list of destinations and loads (sets) traveller types into each of them.
     * Used for displaying the destination traveller types on the destination page
     *
     * @param destinationsList
     * @return the same list of destinations
     */
Takes in a list of destinations and loads (sets) traveller types into each of them.
Used for displaying the destination traveller types on the destination page

@param destinationsList
@return the same list of destinations
Takes in a list of destinations and loads ( sets ) traveller types into each of them . Used for displaying the destination traveller types on the destination page @param destinationsList @return the same list of destinations
private List<Destination> loadTravellerTypes(List<Destination> destinationsList) {
        for (Destination destination : destinationsList) {
            List<TravellerType> travellerTypes = destinationRepository.getDestinationsTravellerTypes(destination.getDestinationId());
            Map<Integer, TravellerType> travellerTypesMap = new HashMap<>();
            for (TravellerType i : travellerTypes) {
                travellerTypesMap.put(i.getTravellerTypeId(), i);
            }
            destination.setTravellerTypes(travellerTypesMap);
        }
        return destinationsList;
    }
private List < Destination > loadTravellerTypes ( List < Destination > destinationsList ) { for ( Destination destination : destinationsList ) { List < TravellerType > travellerTypes = destinationRepository . getDestinationsTravellerTypes ( destination . getDestinationId ( ) ) ; Map < Integer , TravellerType > travellerTypesMap = new HashMap < > ( ) ; for ( TravellerType i : travellerTypes ) { travellerTypesMap . put ( i . getTravellerTypeId ( ) , i ) ; } destination . setTravellerTypes ( travellerTypesMap ) ; } return destinationsList ; }
Takes in a list of destinations and loads (sets) traveller types into each of them.
Takes in a list of destinations and loads ( sets ) traveller types into each of them .