java.lang.Object
java.lang.Record
records.LeaveBalanceRecord
public record LeaveBalanceRecord(int employeeID, int sickBalance, int vacationBalance, int paternalBalance, int bereavementBalance)
extends Record
Represents a leave balance record.
This record contains information about an employee's leave balances, including sick balance,
vacation balance, paternal balance, and bereavement balance.
Available methods:
-
Constructor Summary
ConstructorsConstructorDescriptionLeaveBalanceRecord
(int employeeID, int sickBalance, int vacationBalance, int paternalBalance, int bereavementBalance) Creates an instance of aLeaveBalanceRecord
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the value of thebereavementBalance
record component.int
Returns the value of theemployeeID
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thepaternalBalance
record component.int
Returns the value of thesickBalance
record component.String[]
toArray()
Converts the LeaveBalanceRecord to an array of strings.final String
toString()
Returns a string representation of this record class.int
Returns the value of thevacationBalance
record component.withBereavementBalance
(int bereavementBalance) Returns a new LeaveBalanceRecord with the specified bereavement balance.withPaternalBalance
(int paternalBalance) Returns a new LeaveBalanceRecord with the specified paternal balance.withSickBalance
(int sickBalance) Returns a new LeaveBalanceRecord with the specified sick balance.withVacationBalance
(int vacationBalance) Returns a new LeaveBalanceRecord with the specified vacation balance.
-
Constructor Details
-
LeaveBalanceRecord
public LeaveBalanceRecord(int employeeID, int sickBalance, int vacationBalance, int paternalBalance, int bereavementBalance) Creates an instance of aLeaveBalanceRecord
record class.- Parameters:
employeeID
- the value for theemployeeID
record componentsickBalance
- the value for thesickBalance
record componentvacationBalance
- the value for thevacationBalance
record componentpaternalBalance
- the value for thepaternalBalance
record componentbereavementBalance
- the value for thebereavementBalance
record component
-
-
Method Details
-
withSickBalance
Returns a new LeaveBalanceRecord with the specified sick balance.- Parameters:
sickBalance
- the sick balance- Returns:
- a new LeaveBalanceRecord with the specified sick balance
-
withVacationBalance
Returns a new LeaveBalanceRecord with the specified vacation balance.- Parameters:
vacationBalance
- the vacation balance- Returns:
- a new LeaveBalanceRecord with the specified vacation balance
-
withPaternalBalance
Returns a new LeaveBalanceRecord with the specified paternal balance.- Parameters:
paternalBalance
- the paternal balance- Returns:
- a new LeaveBalanceRecord with the specified paternal balance
-
withBereavementBalance
Returns a new LeaveBalanceRecord with the specified bereavement balance.- Parameters:
bereavementBalance
- the bereavement balance- Returns:
- a new LeaveBalanceRecord with the specified bereavement balance
-
toArray
Converts the LeaveBalanceRecord to an array of strings.- Returns:
- an array of strings representing the LeaveBalanceRecord
-
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. All components in this record class are compared with '=='. -
employeeID
public int employeeID()Returns the value of theemployeeID
record component.- Returns:
- the value of the
employeeID
record component
-
sickBalance
public int sickBalance()Returns the value of thesickBalance
record component.- Returns:
- the value of the
sickBalance
record component
-
vacationBalance
public int vacationBalance()Returns the value of thevacationBalance
record component.- Returns:
- the value of the
vacationBalance
record component
-
paternalBalance
public int paternalBalance()Returns the value of thepaternalBalance
record component.- Returns:
- the value of the
paternalBalance
record component
-
bereavementBalance
public int bereavementBalance()Returns the value of thebereavementBalance
record component.- Returns:
- the value of the
bereavementBalance
record component
-