Package moblima.control.handlers
Class SettingsHandler
java.lang.Object
moblima.control.handlers.SettingsHandler
The type Settings handler.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
addPublicHoliday
(Settings settings, String strHolidayDate) Add public holiday int.boolean
Check if is authenticated boolean.double
computeTicketPrice
(boolean isBlockbuster, Showtime.ShowType showType, Cinema.ClassType classType, Booking.TicketType ticketType, LocalDateTime showDateTime) Compute ticket price double.double
computeTotalCost
(boolean isBlockbuster, Showtime.ShowType showType, Cinema.ClassType classType, Booking.TicketType ticketType, LocalDateTime showDateTime, int seatCount) Compute total cost double.Gets current account.Gets current system settings.Gets settings.boolean
removePublicHoliday
(Settings settings, String strHolidayDate) Remove public holiday boolean.protected boolean
Save settings boolean.void
setIsAuthenticated
(Account account) Sets is authenticated.void
updateSettings
(Settings settings) Update settings.verifyTicketType
(LocalDateTime showDateTime, Booking.TicketType ticketType) Verify ticket type ticket type.
-
Field Details
-
currentSettings
The Current settings. -
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
Gets current account.- Returns:
- the current account
-
setIsAuthenticated
Sets is authenticated.- Parameters:
account
- the account
-
addPublicHoliday
Add public holiday int.- Parameters:
settings
- the settingsstrHolidayDate
- the str holiday date- Returns:
- the int
-
removePublicHoliday
Remove public holiday boolean.- Parameters:
settings
- the settingsstrHolidayDate
- the str holiday date- Returns:
- the boolean
-
updateSettings
Update settings.- Parameters:
settings
- the 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 timeticketType
- 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 blockbustershowType
- the show typeclassType
- the class typeticketType
- the ticket typeshowDateTime
- 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 blockbustershowType
- the show typeclassType
- the class typeticketType
- the ticket typeshowDateTime
- the show date timeseatCount
- the seat count- Returns:
- the double
-
getSettings
Gets settings.- Returns:
- the settings
-
saveSettings
protected boolean saveSettings()Save settings boolean.- Returns:
- the boolean
-