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 theattendanceID
record component.date()
Returns the value of thedate
record component.int
Returns the value of theemployeeID
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefirstName
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of thehoursWorked
record component.lastName()
Returns the value of thelastName
record component.Returns the value of theoverTimeHours
record component.timeIn()
Returns the value of thetimeIn
record component.timeOut()
Returns the value of thetimeOut
record component.String[]
toArray()
Converts the AttendanceRecord to an array of strings.final String
toString()
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 aAttendanceRecord
record class.- Parameters:
attendanceID
- the value for theattendanceID
record componentdate
- the value for thedate
record componentemployeeID
- the value for theemployeeID
record componentlastName
- the value for thelastName
record componentfirstName
- the value for thefirstName
record componenttimeIn
- the value for thetimeIn
record componenttimeOut
- the value for thetimeOut
record componenthoursWorked
- the value for thehoursWorked
record componentoverTimeHours
- the value for theoverTimeHours
record 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 theattendanceID
record component.- Returns:
- the value of the
attendanceID
record component
-
date
Returns the value of thedate
record component.- Returns:
- the value of the
date
record component
-
employeeID
public int employeeID()Returns the value of theemployeeID
record component.- Returns:
- the value of the
employeeID
record component
-
lastName
Returns the value of thelastName
record component.- Returns:
- the value of the
lastName
record component
-
firstName
Returns the value of thefirstName
record component.- Returns:
- the value of the
firstName
record component
-
timeIn
Returns the value of thetimeIn
record component.- Returns:
- the value of the
timeIn
record component
-
timeOut
Returns the value of thetimeOut
record component.- Returns:
- the value of the
timeOut
record component
-
hoursWorked
Returns the value of thehoursWorked
record component.- Returns:
- the value of the
hoursWorked
record component
-
overTimeHours
Returns the value of theoverTimeHours
record component.- Returns:
- the value of the
overTimeHours
record component
-