Package records

Record Class AttendanceRecord

java.lang.Object
java.lang.Record
records.AttendanceRecord

public record AttendanceRecord(String attendanceID, LocalDate date, int employeeID, String lastName, String firstName, LocalTime timeIn, LocalTime timeOut, LocalTime hoursWorked, LocalTime overTimeHours) extends Record
Represents an attendance record. This record contains information about an employee's attendance, including the date, employee ID, time in, time out, hours worked, and overtime hours.

Available methods:

  • Constructor Details

    • AttendanceRecord

      public AttendanceRecord(String attendanceID, LocalDate date, int employeeID, String lastName, String firstName, LocalTime timeIn, LocalTime timeOut, LocalTime hoursWorked, LocalTime overTimeHours)
      Creates an instance of a AttendanceRecord record class.
      Parameters:
      attendanceID - the value for the attendanceID record component
      date - the value for the date record component
      employeeID - the value for the employeeID record component
      lastName - the value for the lastName record component
      firstName - the value for the firstName record component
      timeIn - the value for the timeIn record component
      timeOut - the value for the timeOut record component
      hoursWorked - the value for the hoursWorked record component
      overTimeHours - the value for the overTimeHours record component
  • Method Details

    • withTimeIn

      public AttendanceRecord withTimeIn(LocalTime timeIn)
      Returns a new AttendanceRecord with the specified time in.
      Parameters:
      timeIn - the time in
      Returns:
      a new AttendanceRecord with the specified time in
    • withTimeOut

      public AttendanceRecord withTimeOut(LocalTime timeOut)
      Returns a new AttendanceRecord with the specified time out.
      Parameters:
      timeOut - the time-out
      Returns:
      a new AttendanceRecord with the specified time out
    • withHoursWorked

      public AttendanceRecord withHoursWorked(LocalTime hoursWorked)
      Returns a new AttendanceRecord with the specified hours worked.
      Parameters:
      hoursWorked - the hours worked
      Returns:
      a new AttendanceRecord with the specified hours worked
    • withOverTimeHours

      public AttendanceRecord withOverTimeHours(LocalTime overTimeHours)
      Returns a new AttendanceRecord with the specified overtime hours.
      Parameters:
      overTimeHours - the overtime hours
      Returns:
      a new AttendanceRecord with the specified overtime hours
    • toArray

      public String[] toArray()
      Converts the AttendanceRecord to an array of strings.
      Returns:
      an array of strings representing the AttendanceRecord
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • attendanceID

      public String attendanceID()
      Returns the value of the attendanceID record component.
      Returns:
      the value of the attendanceID record component
    • date

      public LocalDate date()
      Returns the value of the date record component.
      Returns:
      the value of the date record component
    • employeeID

      public int employeeID()
      Returns the value of the employeeID record component.
      Returns:
      the value of the employeeID record component
    • lastName

      public String lastName()
      Returns the value of the lastName record component.
      Returns:
      the value of the lastName record component
    • firstName

      public String firstName()
      Returns the value of the firstName record component.
      Returns:
      the value of the firstName record component
    • timeIn

      public LocalTime timeIn()
      Returns the value of the timeIn record component.
      Returns:
      the value of the timeIn record component
    • timeOut

      public LocalTime timeOut()
      Returns the value of the timeOut record component.
      Returns:
      the value of the timeOut record component
    • hoursWorked

      public LocalTime hoursWorked()
      Returns the value of the hoursWorked record component.
      Returns:
      the value of the hoursWorked record component
    • overTimeHours

      public LocalTime overTimeHours()
      Returns the value of the overTimeHours record component.
      Returns:
      the value of the overTimeHours record component