Class TaxRequestLine

java.lang.Object
com.onenetwork.platform.common.tax.TaxRequestLine

public class TaxRequestLine
extends java.lang.Object
Represents a single line of a transaction that needs the tax due determined by a TaxProvider. The following fields are required:
  • shipToAddress - Address where the item is being shipped to
  • shipFromAddress - Address where the item is being shipped from
  • quantity - number of the item being shipped
  • unitPrice - price for each item being shipped
  • unitPriceCurrency - Price currency of item being shipped
  • itemCode - unique identifier for the item being shipped. Likely to be item.getItemName()
  • taxCode - TaxCode for the item being shipped. This is specific to the provider the request is being made to. Can be obtained with TaxService.getTaxCode();
  • hsCode - HS Code for the item being shipped.
  • sysEntId - enterprise id to calculate the tax upon item being shipped.
Attempting to pass a null value for these fields in the constructor or the setters will result in a NullPointerException.
  • Constructor Summary

    Constructors 
    Constructor Description
    TaxRequestLine​(Address shipTo, Address shipFrom, int quantity, double unitPrice, java.lang.String itemCode, java.lang.String taxCode)
    Constructs a TaxRequestLine with all the required parameters.
  • Method Summary

    Modifier and Type Method Description
    java.util.Optional<java.lang.String> getDescription()
    Description of this line
    java.lang.String getHsCode()
    HS code (i.e.
    java.lang.String getItemCode()
    Unique String identifying the item
    int getQuantity()
    number of items being sent
    Address getShipFromAddress()
    Address this line is coming from
    Address getShipToAddress()
    Address this line is going to
    java.lang.Long getSysEntId()
    Enterprise id for which needs tax calculation.
    java.lang.String getTaxCode()
    TaxCode string identifying what type of item this is.
    double getUnitPrice()
    Price per item being sent
    java.lang.String getUnitPriceCurrency()
    Currency for unit price of an item
    void setDescription​(java.lang.String description)
    Set the description of this line
    void setHsCode​(java.lang.String hsCode)
    Sets HS code (i.e.
    void setItemCode​(java.lang.String itemCode)
    Set the unique String identifying the item Passing a null value will result in a NullPointerException Generally this should be the item name: item.getItemName()
    void setQuantity​(int quantity)
    Set the number of items being sent
    void setShipFromAddress​(Address address)
    Set Address this line is coming from Passing a null value will result in a NullPointerException
    void setShipToAddress​(Address address)
    Set Address this line is going to Passing a null value will result in a NullPointerException
    void setSysEntId​(java.lang.Long sysEntId)
    Sets the enterprise id for which needs tax calculation.
    void setTaxCode​(java.lang.String taxCode)
    Sets the TaxCode string identifying what type of item this is.
    void setUnitPrice​(double unitPrice)
    Set the price per item being sent
    void setUnitPriceCurrency​(java.lang.String unitPriceCurrency)
    Sets currency for unit price of an item

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TaxRequestLine

      public TaxRequestLine​(Address shipTo, Address shipFrom, int quantity, double unitPrice, java.lang.String itemCode, java.lang.String taxCode)
      Constructs a TaxRequestLine with all the required parameters. None of the parameters may be null. Any other parameters on the TaxRequestLine may be added via the setters on this class. Attempting to pass a null value to this constructor will result in a NullPointerException.
  • Method Details

    • getShipToAddress

      public Address getShipToAddress()
      Address this line is going to
    • setShipToAddress

      public void setShipToAddress​(Address address)
      Set Address this line is going to Passing a null value will result in a NullPointerException
    • getShipFromAddress

      public Address getShipFromAddress()
      Address this line is coming from
    • setShipFromAddress

      public void setShipFromAddress​(Address address)
      Set Address this line is coming from Passing a null value will result in a NullPointerException
    • getQuantity

      public int getQuantity()
      number of items being sent
    • setQuantity

      public void setQuantity​(int quantity)
      Set the number of items being sent
    • getUnitPrice

      public double getUnitPrice()
      Price per item being sent
    • setUnitPrice

      public void setUnitPrice​(double unitPrice)
      Set the price per item being sent
    • getItemCode

      public java.lang.String getItemCode()
      Unique String identifying the item
    • setItemCode

      public void setItemCode​(java.lang.String itemCode)
      Set the unique String identifying the item Passing a null value will result in a NullPointerException Generally this should be the item name: item.getItemName()
    • getDescription

      public java.util.Optional<java.lang.String> getDescription()
      Description of this line
    • setDescription

      public void setDescription​(java.lang.String description)
      Set the description of this line
    • getTaxCode

      public java.lang.String getTaxCode()
      TaxCode string identifying what type of item this is. This will be specific to the provider being used. This should be determined via TaxService.getTaxCode();
    • setTaxCode

      public void setTaxCode​(java.lang.String taxCode)
      Sets the TaxCode string identifying what type of item this is. Passing a null value will result in a NullPointerException
    • getHsCode

      public java.lang.String getHsCode()
      HS code (i.e. Harmonized System) of an item.
    • setHsCode

      public void setHsCode​(java.lang.String hsCode)
      Sets HS code (i.e. Harmonized System) of an item.
    • getSysEntId

      public java.lang.Long getSysEntId()
      Enterprise id for which needs tax calculation.
    • setSysEntId

      public void setSysEntId​(java.lang.Long sysEntId)
      Sets the enterprise id for which needs tax calculation.
    • getUnitPriceCurrency

      public java.lang.String getUnitPriceCurrency()
      Currency for unit price of an item
    • setUnitPriceCurrency

      public void setUnitPriceCurrency​(java.lang.String unitPriceCurrency)
      Sets currency for unit price of an item