Record Class EmployeeSales
java.lang.Object
java.lang.Record
app.model.EmployeeSales
public record EmployeeSales(String employeeName, long orderCount, BigDecimal salesRevenue)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for theemployeeNamerecord component.private final longThe field for theorderCountrecord component.private final BigDecimalThe field for thesalesRevenuerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEmployeeSales(String employeeName, long orderCount, BigDecimal salesRevenue) Creates an instance of aEmployeeSalesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theemployeeNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of theorderCountrecord component.Returns the value of thesalesRevenuerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
employeeName
The field for theemployeeNamerecord component. -
orderCount
private final long orderCountThe field for theorderCountrecord component. -
salesRevenue
The field for thesalesRevenuerecord component.
-
-
Constructor Details
-
EmployeeSales
Creates an instance of aEmployeeSalesrecord class.- Parameters:
employeeName- the value for theemployeeNamerecord componentorderCount- the value for theorderCountrecord componentsalesRevenue- the value for thesalesRevenuerecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
employeeName
Returns the value of theemployeeNamerecord component.- Returns:
- the value of the
employeeNamerecord component
-
orderCount
public long orderCount()Returns the value of theorderCountrecord component.- Returns:
- the value of the
orderCountrecord component
-
salesRevenue
Returns the value of thesalesRevenuerecord component.- Returns:
- the value of the
salesRevenuerecord component
-