Class Customer

java.lang.Object
bcu.cmp5332.bookingsystem.model.Customer

public class Customer extends Object
Represents a customer of the flight booking system.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Customer(int id, String name, String phone, String email, boolean isDeleted, boolean isVIP)
    Constructs a new Customer object with the specified attributes.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a booking to the list of bookings made by the customer.
    Retrieves a copy of the list of bookings made by the customer.
    boolean
    Checks if the customer is deleted from the system.
    Retrieves a short string representation of the customer's details.
    Retrieves the email address of the customer.
    int
    Retrieves the unique identifier of the customer.
    Retrieves the name of the customer.
    Retrieves the phone number of the customer.
    Retrieves a detailed string representation of the customer's details and bookings.
    boolean
     
    void
    Marks the customer as deleted from the system.
    void
    Sets the email address of the customer.
    void
    setId(int id)
    Sets the unique identifier of the customer.
    void
    Sets the name of the customer.
    void
    Sets the phone number of the customer.
    void
    Prints detailed information about the customer and their bookings to the console.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Customer

      public Customer(int id, String name, String phone, String email, boolean isDeleted, boolean isVIP)
      Constructs a new Customer object with the specified attributes.
      Parameters:
      id - The unique identifier of the customer
      name - The name of the customer
      phone - The phone number of the customer
      email - The email address of the customer
      isDeleted - Indicates whether the customer is deleted from the system
  • Method Details

    • getId

      public int getId()
      Retrieves the unique identifier of the customer.
      Returns:
      The unique identifier of the customer
    • setId

      public void setId(int id)
      Sets the unique identifier of the customer.
      Parameters:
      id - The new unique identifier to be set for the customer
    • getName

      public String getName()
      Retrieves the name of the customer.
      Returns:
      The name of the customer
    • setName

      public void setName(String name)
      Sets the name of the customer.
      Parameters:
      name - The new name to be set for the customer
    • getPhone

      public String getPhone()
      Retrieves the phone number of the customer.
      Returns:
      The phone number of the customer
    • setPhone

      public void setPhone(String phone)
      Sets the phone number of the customer.
      Parameters:
      phone - The new phone number to be set for the customer
    • getEmail

      public String getEmail()
      Retrieves the email address of the customer.
      Returns:
      The email address of the customer
    • setEmail

      public void setEmail(String email)
      Sets the email address of the customer.
      Parameters:
      email - The new email address to be set for the customer
    • getBookings

      public List<Booking> getBookings()
      Retrieves a copy of the list of bookings made by the customer.
      Returns:
      A copy of the list of bookings made by the customer
    • addBooking

      public void addBooking(Booking booking)
      Adds a booking to the list of bookings made by the customer.
      Parameters:
      booking - The booking to be added
    • getDetailsShort

      public String getDetailsShort()
      Retrieves a short string representation of the customer's details.
      Returns:
      A short string representation of the customer's details
    • showDetails

      public void showDetails()
      Prints detailed information about the customer and their bookings to the console.
    • getShowDetails

      public String getShowDetails()
      Retrieves a detailed string representation of the customer's details and bookings.
      Returns:
      A detailed string representation of the customer's details and bookings
    • setDeleted

      public void setDeleted()
      Marks the customer as deleted from the system.
    • getDeleted

      public boolean getDeleted()
      Checks if the customer is deleted from the system.
      Returns:
      True if the customer is deleted, false otherwise
    • isVIP

      public boolean isVIP()