pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.shop.checkout
Class TaxRate

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.component.shop.checkout.TaxRate
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TaxRate>

@Entity(name="checkout_TaxRate")
public class TaxRate
extends AbstractBasicEntity
implements java.lang.Comparable<TaxRate>

The TaxRate.

Version:
$Revision$
Author:
Christian Schatt
See Also:
Serialized Form

Constructor Summary
protected TaxRate()
          Deprecated. 
  TaxRate(java.lang.String n, java.math.BigDecimal p)
          Creates a new TaxRate from the given name and percentage.
  TaxRate(TaxGroup tg)
          Creates a new TaxRate from the given TaxGroup.
  TaxRate(TaxRate tr)
          The copy constructor.
 
Method Summary
 int compareTo(TaxRate tr)
          Compares this TaxRate with the given TaxRate for order.
 boolean equals(java.lang.Object o)
          Determines whether the given Object is equal to this TaxRate.
 java.lang.String getName()
          Returns the name.
 java.math.BigDecimal getPercentage()
          Returns the percentage.
 int hashCode()
          Returns the hash code for this TaxRate.
 java.lang.String toString()
          Returns the String representation of this TaxRate.
 
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

TaxRate

@Deprecated
protected TaxRate()
Deprecated. 

The no-argument constructor used by JAXB and JPA.


TaxRate

public TaxRate(TaxRate tr)
The copy constructor.

Parameters:
tr - the TaxRate to be copied.
Throws:
java.lang.IllegalArgumentException - if the given TaxRate is null.

TaxRate

public TaxRate(java.lang.String n,
               java.math.BigDecimal p)
Creates a new TaxRate from the given name and percentage.

Parameters:
n - the name.
p - the percentage.
Throws:
java.lang.IllegalArgumentException - if the given name or percentage is null.

TaxRate

public TaxRate(TaxGroup tg)
Creates a new TaxRate from the given TaxGroup.

Parameters:
tg - the TaxGroup.
Throws:
java.lang.IllegalArgumentException - if the given TaxGroup is null.
Method Detail

getName

public final java.lang.String getName()
Returns the name.

Returns:
the name.

getPercentage

public final java.math.BigDecimal getPercentage()
Returns the percentage.

Returns:
the percentage.

compareTo

public int compareTo(TaxRate tr)
Compares this TaxRate with the given TaxRate for order.

Specified by:
compareTo in interface java.lang.Comparable<TaxRate>
Parameters:
tr - the TaxRate to be compared.
Returns:
a negative integer, zero, or a positive integer as this TaxRate is less than, equal to, or greater than the given TaxRate.
Throws:
java.lang.IllegalArgumentException - if the given TaxRate is null.

toString

public java.lang.String toString()
Returns the String representation of this TaxRate.

Overrides:
toString in class java.lang.Object
Returns:
the String representation.

equals

public boolean equals(java.lang.Object o)
Determines whether the given Object is equal to this TaxRate. Two TaxRates are considered equal, if their names and percentages are equal.

Overrides:
equals in class AbstractBasicEntity
Parameters:
o - the Object.
Returns:
true, if the given Object is equal to this TaxRate.

hashCode

public int hashCode()
Returns the hash code for this TaxRate.

Overrides:
hashCode in class AbstractBasicEntity
Returns:
the hash code.
See Also:
AbstractBasicEntity.hashCode()