Record Class CalculatedTax
java.lang.Object
java.lang.Record
de.codebarista.shopware.model.core.CalculatedTax
- Record Components:
tax- the actual tax amount, e.g. 0.11 €taxRate- the tax rate, e.g. 7 (for 7%)totalPrice- the total price
public record CalculatedTax(BigDecimal tax, BigDecimal taxRate, BigDecimal totalPrice)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionCalculatedTax(BigDecimal tax, BigDecimal taxRate, BigDecimal totalPrice) Creates an instance of aCalculatedTaxrecord 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.netPrice()tax()Returns the value of thetaxrecord component.taxRate()Returns the value of thetaxRaterecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetotalPricerecord component.
-
Constructor Details
-
CalculatedTax
Creates an instance of aCalculatedTaxrecord class.- Parameters:
tax- the value for thetaxrecord componenttaxRate- the value for thetaxRaterecord componenttotalPrice- the value for thetotalPricerecord component
-
-
Method Details
-
netPrice
-
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. -
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. -
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 withObjects::equals(Object,Object). -
tax
Returns the value of thetaxrecord component.- Returns:
- the value of the
taxrecord component
-
taxRate
Returns the value of thetaxRaterecord component.- Returns:
- the value of the
taxRaterecord component
-
totalPrice
Returns the value of thetotalPricerecord component.- Returns:
- the value of the
totalPricerecord component
-