Class SettingsHandler

java.lang.Object
moblima.control.handlers.SettingsHandler

public class SettingsHandler extends Object
The type Settings handler.
  • Field Details

    • currentSettings

      protected Settings currentSettings
      The Current settings.
    • currentAccount

      protected Account currentAccount
      The Current account.
  • Constructor Details

    • SettingsHandler

      public SettingsHandler()
      Instantiates a new Settings handler.
  • Method Details

    • checkIfIsAuthenticated

      public boolean checkIfIsAuthenticated()
      Check if is authenticated boolean.
      Returns:
      the boolean
    • getCurrentAccount

      public Account getCurrentAccount()
      Gets current account.
      Returns:
      the current account
    • setIsAuthenticated

      public void setIsAuthenticated(Account account)
      Sets is authenticated.
      Parameters:
      account - the account
    • addPublicHoliday

      public int addPublicHoliday(Settings settings, String strHolidayDate)
      Add public holiday int.
      Parameters:
      settings - the settings
      strHolidayDate - the str holiday date
      Returns:
      the int
    • removePublicHoliday

      public boolean removePublicHoliday(Settings settings, String strHolidayDate)
      Remove public holiday boolean.
      Parameters:
      settings - the settings
      strHolidayDate - the str holiday date
      Returns:
      the boolean
    • updateSettings

      public void updateSettings(Settings settings)
      Update settings.
      Parameters:
      settings - the settings
    • getCurrentSettings

      public Settings getCurrentSettings()
      Gets current system settings.
      Returns:
      the current system settings
    • verifyTicketType

      public Booking.TicketType verifyTicketType(LocalDateTime showDateTime, Booking.TicketType ticketType)
      Verify ticket type ticket type.
      Parameters:
      showDateTime - the show date time
      ticketType - the ticket type
      Returns:
      the ticket type
    • computeTicketPrice

      public double computeTicketPrice(boolean isBlockbuster, Showtime.ShowType showType, Cinema.ClassType classType, Booking.TicketType ticketType, LocalDateTime showDateTime)
      Compute ticket price double.
      Parameters:
      isBlockbuster - the is blockbuster
      showType - the show type
      classType - the class type
      ticketType - the ticket type
      showDateTime - the show date time
      Returns:
      the double
    • computeTotalCost

      public double computeTotalCost(boolean isBlockbuster, Showtime.ShowType showType, Cinema.ClassType classType, Booking.TicketType ticketType, LocalDateTime showDateTime, int seatCount)
      Compute total cost double.
      Parameters:
      isBlockbuster - the is blockbuster
      showType - the show type
      classType - the class type
      ticketType - the ticket type
      showDateTime - the show date time
      seatCount - the seat count
      Returns:
      the double
    • getSettings

      public Settings getSettings()
      Gets settings.
      Returns:
      the settings
    • saveSettings

      protected boolean saveSettings()
      Save settings boolean.
      Returns:
      the boolean