|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.util.entity.AbstractBasicEntity
org.torweg.pulse.component.shop.checkout.Price
@Entity(name="checkout_Price") public class Price
The Price.
| Constructor Summary | |
|---|---|
protected |
Price()
Deprecated. |
|
Price(java.math.BigDecimal a, TaxRate tr,
java.util.Currency c,
boolean nb)
Creates a new Price from the given amount, TaxRate,
Currency and net-based-flag. |
|
Price(Price p)
The copy constructor. |
|
Price(Price p)
Creates a new Price from the given
org.torweg.pulse.component.shop.model.Price. |
| Method Summary | |
|---|---|
Price |
add(Price p)
Returns a new Price that is the sum of this Price
and the given Price. |
int |
compareTo(Price p)
Compares this Price with the given Price for
order. |
Price |
divide(java.math.BigDecimal d)
Returns a new Price that is the result of the division of
this Price and the given divisor. |
boolean |
equals(java.lang.Object o)
Determines whether the given Object is equal to this
Price. |
java.math.BigDecimal |
getAmount()
Returns the amount, which means either the net amount or the gross amount, according to the net-based-flag. |
java.util.Currency |
getCurrency()
Returns the Currency. |
java.math.BigDecimal |
getGrossAmount()
Returns the gross amount. |
java.math.BigDecimal |
getNetAmount()
Returns the net amount. |
java.math.BigDecimal |
getTaxAmount()
Returns the tax amount. |
TaxRate |
getTaxRate()
Returns the TaxRate. |
int |
hashCode()
Returns the hash code for this Price. |
boolean |
isNetBased()
Returns the net-based-flag, indicating whether this Price is net
based or gross based. |
Price |
multiply(java.math.BigDecimal m)
Returns a new Price that is the product of this
Price and the given multiplicand. |
Price |
subtract(Price p)
Returns a new Price that is the difference of this
Price and the given Price. |
java.lang.String |
toString()
Returns the String representation of this Price. |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity |
|---|
compareTo, getFullQualifiedClassNameJAXB, getId |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
@Deprecated protected Price()
public Price(Price p)
p - the Price to be copied.
java.lang.IllegalArgumentException - if the given Price is null.
public Price(java.math.BigDecimal a, TaxRate tr,
java.util.Currency c,
boolean nb)
Price from the given amount, TaxRate,
Currency and net-based-flag.
a - the amount.tr - the TaxRate.c - the Currency.nb - the net-based-flag.
java.lang.IllegalArgumentException - if the given amount, TaxRate, or Currency is
null.public Price(Price p)
Price from the given
org.torweg.pulse.component.shop.model.Price.
p - the org.torweg.pulse.component.shop.model.Price.
java.lang.IllegalArgumentException - if the given
org.torweg.pulse.component.shop.model.Price is
null.| Method Detail |
|---|
public final java.math.BigDecimal getAmount()
public final TaxRate getTaxRate()
TaxRate.
TaxRate.public final java.util.Currency getCurrency()
Currency.
Currency.public final boolean isNetBased()
Price is net
based or gross based.
public final java.math.BigDecimal getNetAmount()
public final java.math.BigDecimal getGrossAmount()
public final java.math.BigDecimal getTaxAmount()
public final Price add(Price p)
Price that is the sum of this Price
and the given Price. The new Price will be net based, if
this Price is net based.
p - the Price to be added to this Price.
Price.
java.lang.IllegalArgumentException - if the given Price is null or its
TaxRate or its Currency is not equal to the
TaxRate or the Currency of this Price
.public final Price subtract(Price p)
Price that is the difference of this
Price and the given Price. The new Price will be
net based, if this Price is net based.
p - the Price to be subtracted from this
Price.
Price.
java.lang.IllegalArgumentException - if the given Price is null or its
TaxRate or its Currency is not equal to the
TaxRate or the Currency of this
Price.public final Price multiply(java.math.BigDecimal m)
Price that is the product of this
Price and the given multiplicand.
m - the multiplicand.
Price.
java.lang.IllegalArgumentException - if the given multiplicand is null.public final Price divide(java.math.BigDecimal d)
Price that is the result of the division of
this Price and the given divisor.
d - the divisor.
Price.
java.lang.IllegalArgumentException - if the given divisor is null.public int compareTo(Price p)
this Price with the given Price for
order.
compareTo in interface java.lang.Comparable<Price>p - the Price to be compared.
this
Price is less than, equal to, or greater than the given
Price.
java.lang.IllegalArgumentException - if the given Price is null.public java.lang.String toString()
String representation of this Price.
toString in class java.lang.ObjectString representation.public boolean equals(java.lang.Object o)
Object is equal to this
Price. Two Prices are considered equal, if their amounts,
TaxRates, Currencys and net-based-flags are equal.
equals in class AbstractBasicEntityo - the Object.
true, if the given Object is equal to
this Price.public int hashCode()
Price.
hashCode in class AbstractBasicEntityAbstractBasicEntity.hashCode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||