Class Booking

java.lang.Object
com.montytskyi.Bookings.Implementations.Booking
All Implemented Interfaces:
Rentable, StatusHaveable

public class Booking extends Object implements Rentable
The class which represents the booking in the dormitory. The class contains the info about the rented place, the person who rents it, the price and the current status
  • Constructor Details

    • Booking

      public Booking()
      The empty constructor
    • Booking

      public Booking(Liveable place, Userable renter, double price)
      The constructor with parameters without status
      Parameters:
      place - - represents the place rented by the user
      renter - - the client who rents the place
      price - - the price paid for the rent
    • Booking

      public Booking(Liveable place, Userable renter, double price, Status bookingStatus)
      The constructor with all the parameters possible
      Parameters:
      place - - represents the place rented by the user
      renter - - the client who rents the place
      price - - the price paid for the rent
      bookingStatus - - the current status of the booking
  • Method Details

    • setRentPlace

      public void setRentPlace(Liveable place)
      The setter method to define the place for renting
      Specified by:
      setRentPlace in interface Rentable
      Parameters:
      place - - the place rented by the client
    • setRenter

      public void setRenter(Userable renter)
      The setter method to define the person who rents the place
      Specified by:
      setRenter in interface Rentable
      Parameters:
      renter - - the client who rents the place
    • setPrice

      public void setPrice(double price)
      The setter method which allows to set the price for the rent
      Specified by:
      setPrice in interface Rentable
      Parameters:
      price - - the price for the rent
    • setStatus

      public void setStatus(String stringLabel)
      The setter method which allows to set the current status for the rent
      Specified by:
      setStatus in interface Rentable
      Specified by:
      setStatus in interface StatusHaveable
      Parameters:
      stringLabel - - the label which contains the information about the status
    • getRentPlace

      public Liveable getRentPlace()
      The getter method that returns the place rented by the user
      Specified by:
      getRentPlace in interface Rentable
      Returns:
      place - the place rented by the user
    • getRentPrice

      public double getRentPrice()
      The getter method that returns the price for the rent
      Specified by:
      getRentPrice in interface Rentable
      Returns:
      price - the price for the rent
    • getRenter

      public Userable getRenter()
      The getter method that returns the renter who rents the place
      Specified by:
      getRenter in interface Rentable
      Returns:
      renter - the client who rents the place
    • getStatus

      public Status getStatus()
      The getter method that returns the status of the current renting
      Specified by:
      getStatus in interface Rentable
      Specified by:
      getStatus in interface StatusHaveable
      Returns:
      bookingStatus - the current status of the renting