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 aLeaveBalanceRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebereavementBalancerecord component.intReturns the value of theemployeeIDrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thepaternalBalancerecord component.intReturns the value of thesickBalancerecord component.String[]toArray()Converts the LeaveBalanceRecord to an array of strings.final StringtoString()Returns a string representation of this record class.intReturns the value of thevacationBalancerecord 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 aLeaveBalanceRecordrecord class.- Parameters:
employeeID- the value for theemployeeIDrecord componentsickBalance- the value for thesickBalancerecord componentvacationBalance- the value for thevacationBalancerecord componentpaternalBalance- the value for thepaternalBalancerecord componentbereavementBalance- the value for thebereavementBalancerecord 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 theemployeeIDrecord component.- Returns:
- the value of the
employeeIDrecord component
-
sickBalance
public int sickBalance()Returns the value of thesickBalancerecord component.- Returns:
- the value of the
sickBalancerecord component
-
vacationBalance
public int vacationBalance()Returns the value of thevacationBalancerecord component.- Returns:
- the value of the
vacationBalancerecord component
-
paternalBalance
public int paternalBalance()Returns the value of thepaternalBalancerecord component.- Returns:
- the value of the
paternalBalancerecord component
-
bereavementBalance
public int bereavementBalance()Returns the value of thebereavementBalancerecord component.- Returns:
- the value of the
bereavementBalancerecord component
-