public class InvoiceLine
extends java.lang.Object
Constructor and Description |
---|
InvoiceLine(java.lang.String itemName,
java.lang.String unitCode,
double quantity,
double price,
java.lang.String currency) |
InvoiceLine(java.lang.String itemName,
java.lang.String unitCode,
double quantity,
double price,
java.lang.String currency,
Tax tax) |
Modifier and Type | Method and Description |
---|---|
javax.money.CurrencyUnit |
getCurrency()
Returns the currency of the price of the line
|
java.lang.String |
getItemName()
Returns the item name of the line
|
javax.money.MonetaryAmount |
getLineExtensionAmount()
Returns the line extension amount.
|
javax.money.MonetaryAmount |
getPrice()
Returns the price of a single item of the line
|
double |
getQuantity()
Returns the quantity of items of the line
|
Tax |
getTax()
Returns the Tax instance associated with the line
|
java.lang.String |
getUnitCode()
Returns the unit code of the quantity of the line
|
boolean |
hasTax(Tax tax)
Returns true if the line is associated to an equivalent Tax instance
|
void |
setCurrency(java.lang.String currency)
Sets the currency of the price of the line
Accepts three letter ISO-4217 currencu codes.
|
void |
setItemName(java.lang.String itemName)
Sets the item name of the line
|
void |
setPrice(double price)
Sets the price of a single item of the line
|
void |
setQuantity(double quantity)
Sets the quantity of items of the line
|
void |
setTax(Tax tax)
Associates a Tax instance to the line
|
void |
setUnitCode(java.lang.String unitCode)
Sets the unit code of the quantity of items of the line
|
public InvoiceLine(java.lang.String itemName, java.lang.String unitCode, double quantity, double price, java.lang.String currency)
itemName
- the name of the itemunitCode
- the unit code of the quantity of itemsquantity
- the quantity of itemsprice
- the price of a single itemcurrency
- the currency of the pricepublic InvoiceLine(java.lang.String itemName, java.lang.String unitCode, double quantity, double price, java.lang.String currency, Tax tax)
itemName
- the name of the itemunitCode
- the unit code of the quantity of itemsquantity
- the quantity of itemsprice
- the price of a single itemcurrency
- the currency of the pricetax
- a Tax instancepublic java.lang.String getItemName()
public void setItemName(java.lang.String itemName)
itemName
- the item namepublic java.lang.String getUnitCode()
public void setUnitCode(java.lang.String unitCode)
unitCode
- the unit codepublic double getQuantity()
public void setQuantity(double quantity)
quantity
- the quantity of itemspublic javax.money.MonetaryAmount getPrice()
public void setPrice(double price)
price
- the price of a single itempublic javax.money.CurrencyUnit getCurrency()
public void setCurrency(java.lang.String currency)
Accepts three letter ISO-4217 currencu codes.
currency
- public javax.money.MonetaryAmount getLineExtensionAmount()
That is, the price multiplied by the quantity of items of the line.
public Tax getTax()
public void setTax(Tax tax)
tax
- a Tax instancepublic boolean hasTax(Tax tax)
tax
- a tax instance