Class Tax


  • public class Tax
    extends java.lang.Object
    Represents the tax, which applies generally to line items or additional charges.
    • Constructor Detail

      • Tax

        public Tax​(AbstractAmount amount)
        Creates a new tax with a given amount.
    • Method Detail

      • addTarget

        public void addTarget​(Taxable target)
        Adds a new target to this tax.
      • addTargets

        public void addTargets​(java.util.List<? extends Taxable> targets)
        Adds multiple targets to this tax.
      • addTargets

        public void addTargets​(Taxable... targets)
        Adds multiple targets to this tax.
      • getTargets

        public java.util.Collection<Taxable> getTargets()
        Returns all targets of this tax.
      • removeTarget

        public void removeTarget​(Taxable target)
        Removes a single target from this tax.
      • clearTargets

        public void clearTargets()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object