Record Class Price
java.lang.Object
java.lang.Record
de.chojo.universalis.entities.Price
- Record Components:
pricePerUnit- unit pricequantity- quantitytotal- total
Price of a listing
-
Constructor Summary
ConstructorsConstructorDescriptionPrice(int pricePerUnit, int quantity, int total) Creates an instance of aPricerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thepricePerUnitrecord component.intquantity()Returns the value of thequantityrecord component.final StringtoString()Returns a string representation of this record class.inttotal()Returns the value of thetotalrecord component.
-
Constructor Details
-
Price
public Price(int pricePerUnit, int quantity, int total) Creates an instance of aPricerecord class.- Parameters:
pricePerUnit- the value for thepricePerUnitrecord componentquantity- the value for thequantityrecord componenttotal- the value for thetotalrecord 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
pricePerUnit
public int pricePerUnit()Returns the value of thepricePerUnitrecord component.- Returns:
- the value of the
pricePerUnitrecord component
-
quantity
-
total
-