Class StaffHandler

java.lang.Object
moblima.control.handlers.StaffHandler

public class StaffHandler extends Object
The type Staff handler.
  • Field Details

    • staffs

      protected List<Staff> staffs
      The Staffs.
    • currentStaff

      protected Staff currentStaff
      The Current staff.
  • Constructor Details

    • StaffHandler

      public StaffHandler()
      Instantiates a new Staff handler.
  • Method Details

    • getCurrentStaff

      public Staff getCurrentStaff()
      Gets current staff.
      Returns:
      the current staff
    • setCurrentStaff

      public void setCurrentStaff(int staffIdx)
      Sets current staff.
      Parameters:
      staffIdx - the staff idx
    • validateUsernameAvailability

      public boolean validateUsernameAvailability(String username)
      Validate username availability boolean.
      Parameters:
      username - the username
      Returns:
      the boolean
    • getStaffs

      public List<Staff> getStaffs()
      Gets staffs.
      Returns:
      the staffs
    • getStaff

      public Staff getStaff(int staffIdx)
      Gets staff.
      Parameters:
      staffIdx - the staff idx
      Returns:
      the staff
    • getStaff

      public Staff getStaff(String username)
      Gets staff.
      Parameters:
      username - the username
      Returns:
      the staff
    • getStaffIdx

      public int getStaffIdx(String staffId)
      Gets staff idx.
      Parameters:
      staffId - the staff id
      Returns:
      the staff idx
    • addStaff

      public int addStaff(String name, String username, String password)
      Add staff int.
      Parameters:
      name - the name
      username - the username
      password - the password
      Returns:
      the int
    • saveStaffs

      protected boolean saveStaffs()
      Save staffs boolean.
      Returns:
      the boolean