Package com.uca.bookings

## Class Booking

- java.lang.Object
- - com.uca.bookings.Booking

    public class Booking
    extends java.lang.Object

Represent a flight booking

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static Booking` `createBooking​(org.joda.money.Money price, Flight flight, Customer customer, Passenger passenger)` Static constructor
`static Booking` `createBooking​(org.joda.money.Money price, Flight flight, Customer customer, Passenger passenger, java.lang.String seatNumber)` Static constructor
`Customer` `getCustomer()` Getter
`java.time.ZonedDateTime` `getDate()` Getter
`Flight` `getFlight()` Getter
`java.util.UUID` `getId()` Getter
`Passenger` `getPassenger()` Getter
`org.joda.money.Money` `getPrice()` Getter
`java.lang.String` `getSeatNumber()` Getter
`State` `getState()` Getter
`int` `hashCode()` Redefinition of hashCode
`static void` `removeBooking​(Booking booking)`
`void` `setSeatNumber​(java.lang.String seatNumber)` Setter
`java.lang.String` `toString()` Redefinition of toString

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Method Detail

#### createBooking

    public static Booking createBooking​(org.joda.money.Money price,
                                        Flight flight,
                                        Customer customer,
                                        Passenger passenger)

Static constructor

Parameters:
  `price` - the booking price
  `flight` - the booking flight
  `customer` - the booking customer
  `passenger` - the booking passenger
Throws:
  `java.lang.IllegalArgumentException` - on null parameter or unreservable flight

#### createBooking

    public static Booking createBooking​(org.joda.money.Money price,
                                        Flight flight,
                                        Customer customer,
                                        Passenger passenger,
                                        java.lang.String seatNumber)

Static constructor

Parameters:
  `price` - the booking price
  `flight` - the booking flight
  `customer` - the booking customer
  `passenger` - the booking passenger
  `seatNumber` - the booking seat number
Throws:
  `java.lang.IllegalArgumentException` - on null parameter or unreservable flight

#### getState

    public State getState()

Getter

Returns:
  booking state

#### getFlight

    public Flight getFlight()

Getter

Returns:
  booking flight

#### getPrice

    public org.joda.money.Money getPrice()

Getter

Returns:
  booking state

#### getId

    public java.util.UUID getId()

Getter

Returns:
  booking identifier

#### getDate

    public java.time.ZonedDateTime getDate()

Getter

Returns:
  booking date

#### getPassenger

    public Passenger getPassenger()

Getter

Returns:
  booking passenger

#### getSeatNumber

    public java.lang.String getSeatNumber()

Getter

Returns:
  booking seat number

#### getCustomer

    public Customer getCustomer()

Getter

Returns:
  booking customer

#### setSeatNumber

    public void setSeatNumber​(java.lang.String seatNumber)

Setter

Parameters:
  `seatNumber` - the booking seat number
Throws:
  `java.lang.IllegalArgumentException` - on null

#### removeBooking

    public static void removeBooking​(Booking booking)

#### hashCode

    public int hashCode()

Redefinition of hashCode

Overrides:
  `hashCode` in class `java.lang.Object`
Returns:
  the hashcode

#### toString

    public java.lang.String toString()

Redefinition of toString

Overrides:
  `toString` in class `java.lang.Object`
Returns:
  a string refering to passenger and flight