|
@ -1,4 +1,63 @@ |
|
|
package hs.fulda.de.ci.exam.project; |
|
|
package hs.fulda.de.ci.exam.project; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
|
|
|
|
import static hs.fulda.de.ci.exam.project.PaymentStatus.Completed; |
|
|
|
|
|
import static hs.fulda.de.ci.exam.project.ReservationStatus.Confirmed; |
|
|
|
|
|
|
|
|
public class FlightReservation { |
|
|
public class FlightReservation { |
|
|
|
|
|
String reservationNumber; |
|
|
|
|
|
FlightInstance flight; |
|
|
|
|
|
HashMap<Passenger, FlightSeat> seatMap; |
|
|
|
|
|
ReservationStatus status; |
|
|
|
|
|
|
|
|
|
|
|
public FlightReservation(String reservationNumber, FlightInstance flight, HashMap<Passenger, FlightSeat> seatMap, ReservationStatus status) { |
|
|
|
|
|
this.reservationNumber = reservationNumber; |
|
|
|
|
|
this.flight = flight; |
|
|
|
|
|
this.seatMap = seatMap; |
|
|
|
|
|
this.status = status; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FlightReservation(){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getReservationNumber() { |
|
|
|
|
|
return reservationNumber; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setReservationNumber(String reservationNumber) { |
|
|
|
|
|
this.reservationNumber = reservationNumber; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FlightInstance getFlight() { |
|
|
|
|
|
return flight; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setFlight(FlightInstance flight) { |
|
|
|
|
|
this.flight = flight; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public HashMap<Passenger, FlightSeat> getSeatMap() { |
|
|
|
|
|
return seatMap; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setSeatMap(HashMap<Passenger, FlightSeat> seatMap) { |
|
|
|
|
|
this.seatMap = seatMap; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ReservationStatus getStatus() { |
|
|
|
|
|
return status; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setStatus(ReservationStatus status) { |
|
|
|
|
|
this.status = status; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void makePayment(Payment credit_card_payment) { |
|
|
|
|
|
System.out.println("processing payment"); |
|
|
|
|
|
credit_card_payment.status = Completed; |
|
|
|
|
|
status = Confirmed; |
|
|
|
|
|
} |
|
|
} |
|
|
} |