|
|
|
|
|
||||||||||
| 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.TotalPrice
@Entity(name="checkout_TotalPrice") public class TotalPrice
The TotalPrice.
| Nested Class Summary | |
|---|---|
static class |
TotalPrice.Quota
The Quota. |
| Constructor Summary | |
|---|---|
protected |
TotalPrice()
Deprecated. |
|
TotalPrice(java.util.Collection<? extends Price> p,
java.util.Currency c,
boolean nb)
Creates a new TotalPrice from the given Prices,
Currency and net-based-flag. |
|
TotalPrice(java.util.Map<? extends TaxRate,? extends java.math.BigDecimal> aq,
java.util.Currency c,
boolean nb)
Creates a new TotalPrice from the given amount quotas,
Currency and net-based-flag. |
|
TotalPrice(Price p)
Creates a new TotalPrice from the given Price. |
|
TotalPrice(ShoppingCart.Total t,
java.util.Currency c,
boolean nb)
Deprecated. |
|
TotalPrice(TotalPrice tp)
The copy constructor. |
| Method Summary | |
|---|---|
TotalPrice |
add(Price p)
Returns a new TotalPrice that is the sum of this
TotalPrice and the given Price. |
TotalPrice |
add(TotalPrice tp)
Returns a new TotalPrice that is the sum of this
TotalPrice and the given TotalPrice. |
int |
compareTo(TotalPrice tp)
Compares this TotalPrice with the given
TotalPrice for order. |
boolean |
equals(java.lang.Object o)
Determines whether the given Object is equal to this
TotalPrice. |
java.math.BigDecimal |
getAmount()
Returns the amount. |
TotalPrice.Quota |
getAmountQuota(TaxRate tr)
Returns the amount quota for the given TaxRate. |
java.util.SortedSet<TotalPrice.Quota> |
getAmountQuotas()
Returns a SortedSet holding the amount quotas. |
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. |
TotalPrice.Quota |
getTaxQuota(TaxRate tr)
Returns the tax quota for the given TaxRate. |
java.util.SortedSet<TotalPrice.Quota> |
getTaxQuotas()
Returns the tax quotas. |
int |
hashCode()
Returns the hash code for this TotalPrice. |
boolean |
isNetBased()
Returns the net-based-flag, indicating whether this TotalPrice is
net based or gross based. |
TotalPrice |
subtract(Price p)
Returns a new TotalPrice that is the difference of this
TotalPrice and the given Price. |
TotalPrice |
subtract(TotalPrice tp)
Returns a new TotalPrice that is the difference of this
TotalPrice and the given TotalPrice. |
java.lang.String |
toString()
Returns the String representation of this TotalPrice. |
| 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 TotalPrice()
public TotalPrice(TotalPrice tp)
tp - the TotalPrice to be copied.
java.lang.IllegalArgumentException - if the given TotalPrice is null.public TotalPrice(Price p)
TotalPrice from the given Price.
p - the Price.
java.lang.IllegalArgumentException - if the given Price is null.
public TotalPrice(java.util.Map<? extends TaxRate,? extends java.math.BigDecimal> aq,
java.util.Currency c,
boolean nb)
TotalPrice from the given amount quotas,
Currency and net-based-flag.
aq - the amount quotas.c - the Currency.nb - the net-based-flag.
java.lang.IllegalArgumentException - if the given Map holding the amount quotas is
null or empty or the given Currency is
null.
public TotalPrice(java.util.Collection<? extends Price> p,
java.util.Currency c,
boolean nb)
TotalPrice from the given Prices,
Currency and net-based-flag.
p - the Prices.c - the Currency.nb - the net-based-flag.
java.lang.IllegalArgumentException - if the given Collection of Prices is
null or empty, the given Currency is
null or one of the given Prices'
Currencys is not equal to the given Currency.
@Deprecated
public TotalPrice(ShoppingCart.Total t,
java.util.Currency c,
boolean nb)
TotalPrice from the given Total,
Currency and net-based-flag.
t - the Total.c - the Currency.nb - the net-based-flag.
java.lang.IllegalArgumentException - if the given Total or Currency is
null.| Method Detail |
|---|
public final java.util.SortedSet<TotalPrice.Quota> getAmountQuotas()
SortedSet holding the amount quotas.
public final TotalPrice.Quota getAmountQuota(TaxRate tr)
TaxRate.
tr - the TaxRate.
java.lang.IllegalArgumentException - if the given TaxRate is null.public final java.util.Currency getCurrency()
Currency.
Currency.public final boolean isNetBased()
TotalPrice is
net based or gross based.
public final java.math.BigDecimal getAmount()
public final java.math.BigDecimal getNetAmount()
public final java.math.BigDecimal getGrossAmount()
public final java.util.SortedSet<TotalPrice.Quota> getTaxQuotas()
public final TotalPrice.Quota getTaxQuota(TaxRate tr)
TaxRate.
tr - the TaxRate.
java.lang.IllegalArgumentException - if the given TaxRate is null.public final java.math.BigDecimal getTaxAmount()
public final TotalPrice add(Price p)
TotalPrice that is the sum of this
TotalPrice and the given Price. The new
TotalPrice will be net based, if this TotalPrice
is net based.
p - the Price to be added to this
TotalPrice.
TotalPrice.
java.lang.IllegalArgumentException - if the given Price is null or its
Currency is not equal to the Currency of this
TotalPrice.public final TotalPrice add(TotalPrice tp)
TotalPrice that is the sum of this
TotalPrice and the given TotalPrice. The new
TotalPrice will be net based, if this TotalPrice
is net based.
tp - the TotalPrice to be added to this
TotalPrice.
TotalPrice.
java.lang.IllegalArgumentException - if the given TotalPrice is null or its
Currency is not equal to the Currency of this
TotalPrice.public final TotalPrice subtract(Price p)
TotalPrice that is the difference of this
TotalPrice and the given Price. The new
TotalPrice will be net based, if this TotalPrice
is net based.
p - the Price to be subtracted from this
TotalPrice.
TotalPrice.
java.lang.IllegalArgumentException - if the given Price is null or its
Currency is not equal to the Currency of this
TotalPrice.public final TotalPrice subtract(TotalPrice tp)
TotalPrice that is the difference of this
TotalPrice and the given TotalPrice. The new
TotalPrice will be net based, if this TotalPrice
is net based.
tp - the TotalPrice to be subtracted from this
TotalPrice.
TotalPrice.
java.lang.IllegalArgumentException - if the given TotalPrice is null or its
Currency is not equal to the Currency of this
TotalPrice.public int compareTo(TotalPrice tp)
this TotalPrice with the given
TotalPrice for order.
compareTo in interface java.lang.Comparable<TotalPrice>tp - the TotalPrice to be compared.
this
TotalPrice is less than, equal to, or greater than the
given TotalPrice.
java.lang.IllegalArgumentException - if the given TotalPrice is null.public java.lang.String toString()
String representation of this TotalPrice.
toString in class java.lang.ObjectString representation.public boolean equals(java.lang.Object o)
Object is equal to this
TotalPrice. Two TotalPrices are considered equal, if
their amount quotas, Currencys and net-based-flags are equal.
equals in class AbstractBasicEntityo - the Object.
true, if the given Object is equal to
this TotalPrice.public int hashCode()
TotalPrice.
hashCode in class AbstractBasicEntityAbstractBasicEntity.hashCode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||