Record Class SalesReportRow
java.lang.Object
java.lang.Record
app.model.SalesReportRow
public record SalesReportRow(String itemName, long quantitySold, BigDecimal salesRevenue, BigDecimal estimatedIngredientCost, BigDecimal estimatedGrossProfit)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BigDecimalThe field for theestimatedGrossProfitrecord component.private final BigDecimalThe field for theestimatedIngredientCostrecord component.private final StringThe field for theitemNamerecord component.private final longThe field for thequantitySoldrecord component.private final BigDecimalThe field for thesalesRevenuerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSalesReportRow(String itemName, long quantitySold, BigDecimal salesRevenue, BigDecimal estimatedIngredientCost, BigDecimal estimatedGrossProfit) Creates an instance of aSalesReportRowrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theestimatedGrossProfitrecord component.Returns the value of theestimatedIngredientCostrecord component.final inthashCode()Returns a hash code value for this object.itemName()Returns the value of theitemNamerecord component.longReturns the value of thequantitySoldrecord component.Returns the value of thesalesRevenuerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
itemName
The field for theitemNamerecord component. -
quantitySold
private final long quantitySoldThe field for thequantitySoldrecord component. -
salesRevenue
The field for thesalesRevenuerecord component. -
estimatedIngredientCost
The field for theestimatedIngredientCostrecord component. -
estimatedGrossProfit
The field for theestimatedGrossProfitrecord component.
-
-
Constructor Details
-
SalesReportRow
public SalesReportRow(String itemName, long quantitySold, BigDecimal salesRevenue, BigDecimal estimatedIngredientCost, BigDecimal estimatedGrossProfit) Creates an instance of aSalesReportRowrecord class.- Parameters:
itemName- the value for theitemNamerecord componentquantitySold- the value for thequantitySoldrecord componentsalesRevenue- the value for thesalesRevenuerecord componentestimatedIngredientCost- the value for theestimatedIngredientCostrecord componentestimatedGrossProfit- the value for theestimatedGrossProfitrecord 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. -
itemName
Returns the value of theitemNamerecord component.- Returns:
- the value of the
itemNamerecord component
-
quantitySold
public long quantitySold()Returns the value of thequantitySoldrecord component.- Returns:
- the value of the
quantitySoldrecord component
-
salesRevenue
Returns the value of thesalesRevenuerecord component.- Returns:
- the value of the
salesRevenuerecord component
-
estimatedIngredientCost
Returns the value of theestimatedIngredientCostrecord component.- Returns:
- the value of the
estimatedIngredientCostrecord component
-
estimatedGrossProfit
Returns the value of theestimatedGrossProfitrecord component.- Returns:
- the value of the
estimatedGrossProfitrecord component
-