Package com.nagarro.jsag.fjt.gall.models

Examples of com.nagarro.jsag.fjt.gall.models.Flight


        final ModelAndView modelAndView = new ModelAndView(FlightSearchController.FLIGHT_SEARCH);
        System.out.println("in flight search post");
        try {
            final Iterator<Flight> flightIterator = this.flightSearchService.search(flightSearchData).iterator();
            while (flightIterator.hasNext()) {
                final Flight flight = flightIterator.next();
                System.out.println(flight);
                flightSearchData.addSearchResult(flight);
            }
        } catch (final ServiceException serviceException) {
            System.err.print(serviceException.getMessage());
View Full Code Here


        if (flightSearchData.getOutputPreference().equalsIgnoreCase(FlightHibernateDAOImpl.ORDER_BY_BOTH)) {
            criteria = criteria.addOrder(Property.forName(FlightHibernateDAOImpl.FLIGHT_DURATION).asc());
        }
        final Iterator<Flight> result = criteria.list().iterator();
        while (result.hasNext()) {
            final Flight flight = result.next();
            boolean flightClassFound = false;
            for (final Character flightClass : flight.getFlightClass().toCharArray()) {
                if ((!flightClassFound) && flightClass.toString().equalsIgnoreCase(flightSearchData.getFlightClass())) {
                    flights.add(flight);
                    flightClassFound = true;
                }
            }
View Full Code Here

            CSVFeedReaderService.LOG.debug(MethodUtils.executionMessage());
        }
        try {
            final Iterator<Flight> flightsIterator = this.getFlights().iterator();
            while (flightsIterator.hasNext()) {
                final Flight flight = flightsIterator.next();
                System.out.println(flight);
                this.getFlightDAO().addFlight(flight);
            }
        } catch (final BaseException baseException) {
            this.deregister();
View Full Code Here

     * @throws ParseException
     *             the parse exception is thrown when any of the values parsed is either not type compatible or
     *             {@code null}
     */
    private Flight parse(final Map<String, Iterator<Object>> dataIteratorsMap) throws ParseException {
        final Flight flight = new Flight();
        flight.setNumber((String) dataIteratorsMap.get(
                CSVFeedConstants.HEADERS.get(IntegerConstants.ZERO.getPrimitiveType())).next());
        flight.setDepartureLocationCode((String) dataIteratorsMap.get(
                CSVFeedConstants.HEADERS.get(IntegerConstants.ONE.getPrimitiveType())).next());
        flight.setArrivalLocationCode((String) dataIteratorsMap.get(
                CSVFeedConstants.HEADERS.get(IntegerConstants.TWO.getPrimitiveType())).next());
        flight.setValidTill(DateUtils.getInstance().toSQLDate(
                (java.util.Date) dataIteratorsMap.get(
                        CSVFeedConstants.HEADERS.get(IntegerConstants.THREE.getPrimitiveType())).next()));
        flight.setFlightTime(DateUtils.getInstance().toSQLTime(
                GallConstants.DEFAULT_TIME_FORMAT,
                (String) dataIteratorsMap.get(CSVFeedConstants.HEADERS.get(IntegerConstants.FOUR.getPrimitiveType()))
                        .next()));
        flight.setFlightDuration((Double) dataIteratorsMap.get(
                CSVFeedConstants.HEADERS.get(IntegerConstants.FIVE.getPrimitiveType())).next());
        flight.setFare(new BigDecimal((Long) dataIteratorsMap.get(
                CSVFeedConstants.HEADERS.get(IntegerConstants.SIX.getPrimitiveType())).next()));
        flight.setSeatAvailability((Boolean) dataIteratorsMap.get(
                CSVFeedConstants.HEADERS.get(IntegerConstants.SEVEN.getPrimitiveType())).next());
        flight.setFlightClass((String) dataIteratorsMap.get(
                CSVFeedConstants.HEADERS.get(IntegerConstants.EIGHT.getPrimitiveType())).next());
        return flight;
    }
View Full Code Here

TOP

Related Classes of com.nagarro.jsag.fjt.gall.models.Flight

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.