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 Details

    • itemName

      private final String itemName
      The field for the itemName record component.
    • quantitySold

      private final long quantitySold
      The field for the quantitySold record component.
    • salesRevenue

      private final BigDecimal salesRevenue
      The field for the salesRevenue record component.
    • estimatedIngredientCost

      private final BigDecimal estimatedIngredientCost
      The field for the estimatedIngredientCost record component.
    • estimatedGrossProfit

      private final BigDecimal estimatedGrossProfit
      The field for the estimatedGrossProfit record component.
  • Constructor Details

    • SalesReportRow

      public SalesReportRow(String itemName, long quantitySold, BigDecimal salesRevenue, BigDecimal estimatedIngredientCost, BigDecimal estimatedGrossProfit)
      Creates an instance of a SalesReportRow record class.
      Parameters:
      itemName - the value for the itemName record component
      quantitySold - the value for the quantitySold record component
      salesRevenue - the value for the salesRevenue record component
      estimatedIngredientCost - the value for the estimatedIngredientCost record component
      estimatedGrossProfit - the value for the estimatedGrossProfit record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • itemName

      public String itemName()
      Returns the value of the itemName record component.
      Returns:
      the value of the itemName record component
    • quantitySold

      public long quantitySold()
      Returns the value of the quantitySold record component.
      Returns:
      the value of the quantitySold record component
    • salesRevenue

      public BigDecimal salesRevenue()
      Returns the value of the salesRevenue record component.
      Returns:
      the value of the salesRevenue record component
    • estimatedIngredientCost

      public BigDecimal estimatedIngredientCost()
      Returns the value of the estimatedIngredientCost record component.
      Returns:
      the value of the estimatedIngredientCost record component
    • estimatedGrossProfit

      public BigDecimal estimatedGrossProfit()
      Returns the value of the estimatedGrossProfit record component.
      Returns:
      the value of the estimatedGrossProfit record component