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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattendanceIDrecord component.date()Returns the value of thedaterecord component.intReturns the value of theemployeeIDrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstNamerecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thehoursWorkedrecord component.lastName()Returns the value of thelastNamerecord component.Returns the value of theoverTimeHoursrecord component.timeIn()Returns the value of thetimeInrecord component.timeOut()Returns the value of thetimeOutrecord component.String[]toArray()Converts the AttendanceRecord to an array of strings.final StringtoString()Returns a string representation of this record class.withHoursWorked(LocalTime hoursWorked) Returns a new AttendanceRecord with the specified hours worked.withOverTimeHours(LocalTime overTimeHours) Returns a new AttendanceRecord with the specified overtime hours.withTimeIn(LocalTime timeIn) Returns a new AttendanceRecord with the specified time in.withTimeOut(LocalTime timeOut) Returns a new AttendanceRecord with the specified time out.
-
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 aAttendanceRecordrecord class.- Parameters:
attendanceID- the value for theattendanceIDrecord componentdate- the value for thedaterecord componentemployeeID- the value for theemployeeIDrecord componentlastName- the value for thelastNamerecord componentfirstName- the value for thefirstNamerecord componenttimeIn- the value for thetimeInrecord componenttimeOut- the value for thetimeOutrecord componenthoursWorked- the value for thehoursWorkedrecord componentoverTimeHours- the value for theoverTimeHoursrecord component
-
-
Method Details
-
withTimeIn
Returns a new AttendanceRecord with the specified time in.- Parameters:
timeIn- the time in- Returns:
- a new AttendanceRecord with the specified time in
-
withTimeOut
Returns a new AttendanceRecord with the specified time out.- Parameters:
timeOut- the time-out- Returns:
- a new AttendanceRecord with the specified time out
-
withHoursWorked
Returns a new AttendanceRecord with the specified hours worked.- Parameters:
hoursWorked- the hours worked- Returns:
- a new AttendanceRecord with the specified hours worked
-
withOverTimeHours
Returns a new AttendanceRecord with the specified overtime hours.- Parameters:
overTimeHours- the overtime hours- Returns:
- a new AttendanceRecord with the specified overtime hours
-
toArray
Converts the AttendanceRecord to an array of strings.- Returns:
- an array of strings representing the AttendanceRecord
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
attendanceID
Returns the value of theattendanceIDrecord component.- Returns:
- the value of the
attendanceIDrecord component
-
date
Returns the value of thedaterecord component.- Returns:
- the value of the
daterecord component
-
employeeID
public int employeeID()Returns the value of theemployeeIDrecord component.- Returns:
- the value of the
employeeIDrecord component
-
lastName
Returns the value of thelastNamerecord component.- Returns:
- the value of the
lastNamerecord component
-
firstName
Returns the value of thefirstNamerecord component.- Returns:
- the value of the
firstNamerecord component
-
timeIn
Returns the value of thetimeInrecord component.- Returns:
- the value of the
timeInrecord component
-
timeOut
Returns the value of thetimeOutrecord component.- Returns:
- the value of the
timeOutrecord component
-
hoursWorked
Returns the value of thehoursWorkedrecord component.- Returns:
- the value of the
hoursWorkedrecord component
-
overTimeHours
Returns the value of theoverTimeHoursrecord component.- Returns:
- the value of the
overTimeHoursrecord component
-