Package com.bddinaction.flyinghigh.services

Source Code of com.bddinaction.flyinghigh.services.FrequentFlyerFlightService

package com.bddinaction.flyinghigh.services;

import com.bddinaction.flyinghigh.model.Airport;
import com.bddinaction.flyinghigh.model.Flight;

public class FrequentFlyerFlightService implements FlightService {

    private final AirportService airportService;

    public FrequentFlyerFlightService(AirportService airportService) {
        this.airportService = airportService;
    }

    @Override
    public Flight findFlightByNumber(String airportCode, String flightNumber) {
        Airport departureAirport = airportService.findAirportByCode(airportCode);
        return new Flight(flightNumber,departureAirport, new Airport("SYD","Sydney"), "06:00");
    }
}
TOP

Related Classes of com.bddinaction.flyinghigh.services.FrequentFlyerFlightService

TOP
Copyright © 2018 www.massapi.com. 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.