Record Class MinimizedPrice
java.lang.Object
java.lang.Record
de.chojo.universalis.entities.MinimizedPrice
- Record Components:
pricePerUnit- unit pricequantity- quantity
Price of a listing
-
Constructor Summary
ConstructorsConstructorDescriptionMinimizedPrice(int pricePerUnit, int quantity) Creates an instance of aMinimizedPricerecord 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()The total price.
-
Constructor Details
-
MinimizedPrice
public MinimizedPrice(int pricePerUnit, int quantity) Creates an instance of aMinimizedPricerecord class.- Parameters:
pricePerUnit- the value for thepricePerUnitrecord componentquantity- the value for thequantityrecord component
-
-
Method Details
-
total
public int total()The total price. Manually calculated.- Returns:
- total price
-
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
-