Class Staff

java.lang.Object
csce331.group13.project2.backend.Staff

public class Staff extends Object
Singleton class that manages the in-memory staff cache. Provides methods to add and update employee records.
Author:
Varish Kongara, Austin Glander
  • Field Details

  • Method Details

    • getInstance

      public static Staff getInstance()
      Returns the singleton instance of the Staff class. Ensures only one instance is ever created.
      Returns:
      The single Staff instance.
    • updateStaff

      public boolean updateStaff(Employee employee)
      Updates an existing employee's information in the database.
      Parameters:
      employee - The Employee object with updated values.
      Returns:
      true if the update was successful; false otherwise.
    • addStaff

      public boolean addStaff(Employee employee)
      Adds a new employee to the system. The employee is first inserted into the database, and if successful, the employee is added to the in-memory list.
      Parameters:
      employee - The new employee to add.
      Returns:
      true if successfully added to both DB and memory; false otherwise.