public class LineItem extends GenericParcelable implements Validator, JSONifiable
id
item
colorCode
name
alternateName
price
priceWithModifiers
priceWithModifiersAndItemAndOrderDiscounts
unitQty
unitName
itemCode
note
printed
exchangedLineItem
binName
userData
createdTime
orderClientCreatedTime
discounts
orderLevelDiscounts
discountAmount
orderLevelDiscountAmount
exchanged
modifications
tags
refunded
refund
isRevenue
taxRates
payments
revenueAmount
quantitySold
printGroup
IOrderService
Modifier and Type | Class and Description |
---|---|
static interface |
LineItem.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<LineItem> |
CREATOR |
static JSONifiable.Creator<LineItem> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
LineItem()
Constructs a new empty instance.
|
protected |
LineItem(boolean noInit)
Constructs a new empty instance.
|
|
LineItem(JSONObject jsonObject)
Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
reflected in this instance and vice-versa.
|
|
LineItem(LineItem src)
Constructs a new instance that is a deep copy of the source instance.
|
|
LineItem(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAlternateName()
Clears the 'alternateName' field, the 'has' method for this field will now return false
|
void |
clearBinName()
Clears the 'binName' field, the 'has' method for this field will now return false
|
void |
clearColorCode()
Clears the 'colorCode' field, the 'has' method for this field will now return false
|
void |
clearCreatedTime()
Clears the 'createdTime' field, the 'has' method for this field will now return false
|
void |
clearDiscountAmount()
Clears the 'discountAmount' field, the 'has' method for this field will now return false
|
void |
clearDiscounts()
Clears the 'discounts' field, the 'has' method for this field will now return false
|
void |
clearExchanged()
Clears the 'exchanged' field, the 'has' method for this field will now return false
|
void |
clearExchangedLineItem()
Clears the 'exchangedLineItem' field, the 'has' method for this field will now return false
|
void |
clearId()
Clears the 'id' field, the 'has' method for this field will now return false
|
void |
clearIsRevenue()
Clears the 'isRevenue' field, the 'has' method for this field will now return false
|
void |
clearItem()
Clears the 'item' field, the 'has' method for this field will now return false
|
void |
clearItemCode()
Clears the 'itemCode' field, the 'has' method for this field will now return false
|
void |
clearModifications()
Clears the 'modifications' field, the 'has' method for this field will now return false
|
void |
clearName()
Clears the 'name' field, the 'has' method for this field will now return false
|
void |
clearNote()
Clears the 'note' field, the 'has' method for this field will now return false
|
void |
clearOrderClientCreatedTime()
Clears the 'orderClientCreatedTime' field, the 'has' method for this field will now return false
|
void |
clearOrderLevelDiscountAmount()
Clears the 'orderLevelDiscountAmount' field, the 'has' method for this field will now return false
|
void |
clearOrderLevelDiscounts()
Clears the 'orderLevelDiscounts' field, the 'has' method for this field will now return false
|
void |
clearPayments()
Clears the 'payments' field, the 'has' method for this field will now return false
|
void |
clearPrice()
Clears the 'price' field, the 'has' method for this field will now return false
|
void |
clearPriceWithModifiers()
Clears the 'priceWithModifiers' field, the 'has' method for this field will now return false
|
void |
clearPriceWithModifiersAndItemAndOrderDiscounts()
Clears the 'priceWithModifiersAndItemAndOrderDiscounts' field, the 'has' method for this field will now return false
|
void |
clearPrinted()
Clears the 'printed' field, the 'has' method for this field will now return false
|
void |
clearPrintGroup()
Clears the 'printGroup' field, the 'has' method for this field will now return false
|
void |
clearQuantitySold()
Clears the 'quantitySold' field, the 'has' method for this field will now return false
|
void |
clearRefund()
Clears the 'refund' field, the 'has' method for this field will now return false
|
void |
clearRefunded()
Clears the 'refunded' field, the 'has' method for this field will now return false
|
void |
clearRevenueAmount()
Clears the 'revenueAmount' field, the 'has' method for this field will now return false
|
void |
clearTags()
Clears the 'tags' field, the 'has' method for this field will now return false
|
void |
clearTaxRates()
Clears the 'taxRates' field, the 'has' method for this field will now return false
|
void |
clearUnitName()
Clears the 'unitName' field, the 'has' method for this field will now return false
|
void |
clearUnitQty()
Clears the 'unitQty' field, the 'has' method for this field will now return false
|
void |
clearUserData()
Clears the 'userData' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
LineItem |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
String |
getAlternateName()
Alternate name of the line item.
|
String |
getBinName() |
String |
getColorCode()
Hex code representation of the color assigned to item in the form of #fff, #ffffff, or #ffffffff.
|
Long |
getCreatedTime() |
Long |
getDiscountAmount()
Unnamed fixed discount amount in cents.
|
List<Discount> |
getDiscounts()
List of discounts applied to the line item.
|
Boolean |
getExchanged() |
Reference |
getExchangedLineItem() |
protected GenericClient |
getGenericClient() |
String |
getId()
Unique identifier.
|
Boolean |
getIsRevenue()
True if this item should be counted as revenue, for example gift cards and donations would not.
|
Reference |
getItem()
A reference to the inventory item that was used to create this line item.
|
String |
getItemCode() |
JSONObject |
getJSONObject()
Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
reflected in this instance and vice-versa.
|
List<Modification> |
getModifications()
List of references to modifications applied to this line item.
|
String |
getName()
Line item name.
|
String |
getNote() |
Long |
getOrderClientCreatedTime() |
Long |
getOrderLevelDiscountAmount()
The calculated sum of order level discounts attributed, approximately to the nearest cent, to this the line item.
|
List<Discount> |
getOrderLevelDiscounts()
List of order level discounts attributed to this line item.
|
List<LineItemPayment> |
getPayments()
Payments that apply to this line item
|
Long |
getPrice()
Price of the item, typically in cents of merchant currency.
|
Long |
getPriceWithModifiers()
Price of item after adding all modifications.
|
Long |
getPriceWithModifiersAndItemAndOrderDiscounts()
Price of item after adding all modifications and subtracting all line item and order level discounts.
|
Boolean |
getPrinted()
True if this line item has been printed out on an order printer at least once already.
|
Reference |
getPrintGroup()
Optional reference to the print group that this line item belongs to.
|
Double |
getQuantitySold()
Quantity sold for this line item.
|
Refund |
getRefund()
direct item refund
|
Boolean |
getRefunded()
True if this line item has been refunded
|
Long |
getRevenueAmount()
Revenue collected for this.
|
List<Tag> |
getTags()
List of tags associated with this line item.
|
List<TaxRate> |
getTaxRates()
Tax rates that apply to this line item
|
String |
getUnitName()
Unit name (e.g.
|
Integer |
getUnitQty()
Unit quantity if this line item is priced by quantity, or null if the item is not priced by quantity.
|
String |
getUserData() |
boolean |
hasAlternateName()
Checks whether the 'alternateName' field has been set, however the value could be null
|
boolean |
hasBinName()
Checks whether the 'binName' field has been set, however the value could be null
|
boolean |
hasColorCode()
Checks whether the 'colorCode' field has been set, however the value could be null
|
boolean |
hasCreatedTime()
Checks whether the 'createdTime' field has been set, however the value could be null
|
boolean |
hasDiscountAmount()
Checks whether the 'discountAmount' field has been set, however the value could be null
|
boolean |
hasDiscounts()
Checks whether the 'discounts' field has been set, however the value could be null
|
boolean |
hasExchanged()
Checks whether the 'exchanged' field has been set, however the value could be null
|
boolean |
hasExchangedLineItem()
Checks whether the 'exchangedLineItem' field has been set, however the value could be null
|
boolean |
hasId()
Checks whether the 'id' field has been set, however the value could be null
|
boolean |
hasIsRevenue()
Checks whether the 'isRevenue' field has been set, however the value could be null
|
boolean |
hasItem()
Checks whether the 'item' field has been set, however the value could be null
|
boolean |
hasItemCode()
Checks whether the 'itemCode' field has been set, however the value could be null
|
boolean |
hasModifications()
Checks whether the 'modifications' field has been set, however the value could be null
|
boolean |
hasName()
Checks whether the 'name' field has been set, however the value could be null
|
boolean |
hasNote()
Checks whether the 'note' field has been set, however the value could be null
|
boolean |
hasOrderClientCreatedTime()
Checks whether the 'orderClientCreatedTime' field has been set, however the value could be null
|
boolean |
hasOrderLevelDiscountAmount()
Checks whether the 'orderLevelDiscountAmount' field has been set, however the value could be null
|
boolean |
hasOrderLevelDiscounts()
Checks whether the 'orderLevelDiscounts' field has been set, however the value could be null
|
boolean |
hasPayments()
Checks whether the 'payments' field has been set, however the value could be null
|
boolean |
hasPrice()
Checks whether the 'price' field has been set, however the value could be null
|
boolean |
hasPriceWithModifiers()
Checks whether the 'priceWithModifiers' field has been set, however the value could be null
|
boolean |
hasPriceWithModifiersAndItemAndOrderDiscounts()
Checks whether the 'priceWithModifiersAndItemAndOrderDiscounts' field has been set, however the value could be null
|
boolean |
hasPrinted()
Checks whether the 'printed' field has been set, however the value could be null
|
boolean |
hasPrintGroup()
Checks whether the 'printGroup' field has been set, however the value could be null
|
boolean |
hasQuantitySold()
Checks whether the 'quantitySold' field has been set, however the value could be null
|
boolean |
hasRefund()
Checks whether the 'refund' field has been set, however the value could be null
|
boolean |
hasRefunded()
Checks whether the 'refunded' field has been set, however the value could be null
|
boolean |
hasRevenueAmount()
Checks whether the 'revenueAmount' field has been set, however the value could be null
|
boolean |
hasTags()
Checks whether the 'tags' field has been set, however the value could be null
|
boolean |
hasTaxRates()
Checks whether the 'taxRates' field has been set, however the value could be null
|
boolean |
hasUnitName()
Checks whether the 'unitName' field has been set, however the value could be null
|
boolean |
hasUnitQty()
Checks whether the 'unitQty' field has been set, however the value could be null
|
boolean |
hasUserData()
Checks whether the 'userData' field has been set, however the value could be null
|
boolean |
isNotEmptyDiscounts()
Checks whether the 'discounts' field is set and is not null and is not empty
|
boolean |
isNotEmptyModifications()
Checks whether the 'modifications' field is set and is not null and is not empty
|
boolean |
isNotEmptyOrderLevelDiscounts()
Checks whether the 'orderLevelDiscounts' field is set and is not null and is not empty
|
boolean |
isNotEmptyPayments()
Checks whether the 'payments' field is set and is not null and is not empty
|
boolean |
isNotEmptyTags()
Checks whether the 'tags' field is set and is not null and is not empty
|
boolean |
isNotEmptyTaxRates()
Checks whether the 'taxRates' field is set and is not null and is not empty
|
boolean |
isNotNullAlternateName()
Checks whether the 'alternateName' field is set and is not null
|
boolean |
isNotNullBinName()
Checks whether the 'binName' field is set and is not null
|
boolean |
isNotNullColorCode()
Checks whether the 'colorCode' field is set and is not null
|
boolean |
isNotNullCreatedTime()
Checks whether the 'createdTime' field is set and is not null
|
boolean |
isNotNullDiscountAmount()
Checks whether the 'discountAmount' field is set and is not null
|
boolean |
isNotNullDiscounts()
Checks whether the 'discounts' field is set and is not null
|
boolean |
isNotNullExchanged()
Checks whether the 'exchanged' field is set and is not null
|
boolean |
isNotNullExchangedLineItem()
Checks whether the 'exchangedLineItem' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullIsRevenue()
Checks whether the 'isRevenue' field is set and is not null
|
boolean |
isNotNullItem()
Checks whether the 'item' field is set and is not null
|
boolean |
isNotNullItemCode()
Checks whether the 'itemCode' field is set and is not null
|
boolean |
isNotNullModifications()
Checks whether the 'modifications' field is set and is not null
|
boolean |
isNotNullName()
Checks whether the 'name' field is set and is not null
|
boolean |
isNotNullNote()
Checks whether the 'note' field is set and is not null
|
boolean |
isNotNullOrderClientCreatedTime()
Checks whether the 'orderClientCreatedTime' field is set and is not null
|
boolean |
isNotNullOrderLevelDiscountAmount()
Checks whether the 'orderLevelDiscountAmount' field is set and is not null
|
boolean |
isNotNullOrderLevelDiscounts()
Checks whether the 'orderLevelDiscounts' field is set and is not null
|
boolean |
isNotNullPayments()
Checks whether the 'payments' field is set and is not null
|
boolean |
isNotNullPrice()
Checks whether the 'price' field is set and is not null
|
boolean |
isNotNullPriceWithModifiers()
Checks whether the 'priceWithModifiers' field is set and is not null
|
boolean |
isNotNullPriceWithModifiersAndItemAndOrderDiscounts()
Checks whether the 'priceWithModifiersAndItemAndOrderDiscounts' field is set and is not null
|
boolean |
isNotNullPrinted()
Checks whether the 'printed' field is set and is not null
|
boolean |
isNotNullPrintGroup()
Checks whether the 'printGroup' field is set and is not null
|
boolean |
isNotNullQuantitySold()
Checks whether the 'quantitySold' field is set and is not null
|
boolean |
isNotNullRefund()
Checks whether the 'refund' field is set and is not null
|
boolean |
isNotNullRefunded()
Checks whether the 'refunded' field is set and is not null
|
boolean |
isNotNullRevenueAmount()
Checks whether the 'revenueAmount' field is set and is not null
|
boolean |
isNotNullTags()
Checks whether the 'tags' field is set and is not null
|
boolean |
isNotNullTaxRates()
Checks whether the 'taxRates' field is set and is not null
|
boolean |
isNotNullUnitName()
Checks whether the 'unitName' field is set and is not null
|
boolean |
isNotNullUnitQty()
Checks whether the 'unitQty' field is set and is not null
|
boolean |
isNotNullUserData()
Checks whether the 'userData' field is set and is not null
|
void |
mergeChanges(LineItem src)
Copy all the changed fields from the given source to this instance.
|
void |
resetChangeLog()
Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
|
LineItem |
setAlternateName(String alternateName)
Sets the field 'alternateName'.
|
LineItem |
setBinName(String binName)
Sets the field 'binName'.
|
LineItem |
setColorCode(String colorCode)
Sets the field 'colorCode'.
|
LineItem |
setCreatedTime(Long createdTime)
Sets the field 'createdTime'.
|
LineItem |
setDiscountAmount(Long discountAmount)
Sets the field 'discountAmount'.
|
LineItem |
setDiscounts(List<Discount> discounts)
Sets the field 'discounts'.
|
LineItem |
setExchanged(Boolean exchanged)
Sets the field 'exchanged'.
|
LineItem |
setExchangedLineItem(Reference exchangedLineItem)
Sets the field 'exchangedLineItem'.
|
LineItem |
setId(String id)
Sets the field 'id'.
|
LineItem |
setIsRevenue(Boolean isRevenue)
Sets the field 'isRevenue'.
|
LineItem |
setItem(Reference item)
Sets the field 'item'.
|
LineItem |
setItemCode(String itemCode)
Sets the field 'itemCode'.
|
LineItem |
setModifications(List<Modification> modifications)
Sets the field 'modifications'.
|
LineItem |
setName(String name)
Sets the field 'name'.
|
LineItem |
setNote(String note)
Sets the field 'note'.
|
LineItem |
setOrderClientCreatedTime(Long orderClientCreatedTime)
Sets the field 'orderClientCreatedTime'.
|
LineItem |
setOrderLevelDiscountAmount(Long orderLevelDiscountAmount)
Sets the field 'orderLevelDiscountAmount'.
|
LineItem |
setOrderLevelDiscounts(List<Discount> orderLevelDiscounts)
Sets the field 'orderLevelDiscounts'.
|
LineItem |
setPayments(List<LineItemPayment> payments)
Sets the field 'payments'.
|
LineItem |
setPrice(Long price)
Sets the field 'price'.
|
LineItem |
setPriceWithModifiers(Long priceWithModifiers)
Sets the field 'priceWithModifiers'.
|
LineItem |
setPriceWithModifiersAndItemAndOrderDiscounts(Long priceWithModifiersAndItemAndOrderDiscounts)
Sets the field 'priceWithModifiersAndItemAndOrderDiscounts'.
|
LineItem |
setPrinted(Boolean printed)
Sets the field 'printed'.
|
LineItem |
setPrintGroup(Reference printGroup)
Sets the field 'printGroup'.
|
LineItem |
setQuantitySold(Double quantitySold)
Sets the field 'quantitySold'.
|
LineItem |
setRefund(Refund refund)
Sets the field 'refund'.
|
LineItem |
setRefunded(Boolean refunded)
Sets the field 'refunded'.
|
LineItem |
setRevenueAmount(Long revenueAmount)
Sets the field 'revenueAmount'.
|
LineItem |
setTags(List<Tag> tags)
Sets the field 'tags'.
|
LineItem |
setTaxRates(List<TaxRate> taxRates)
Sets the field 'taxRates'.
|
LineItem |
setUnitName(String unitName)
Sets the field 'unitName'.
|
LineItem |
setUnitQty(Integer unitQty)
Sets the field 'unitQty'.
|
LineItem |
setUserData(String userData)
Sets the field 'userData'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<LineItem> CREATOR
public static final JSONifiable.Creator<LineItem> JSON_CREATOR
public LineItem()
protected LineItem(boolean noInit)
public LineItem(String json) throws IllegalArgumentException
IllegalArgumentException
public LineItem(JSONObject jsonObject)
public LineItem(LineItem src)
public String getId()
public Reference getItem()
public String getColorCode()
public String getName()
public String getAlternateName()
public Long getPrice()
public Long getPriceWithModifiers()
public Long getPriceWithModifiersAndItemAndOrderDiscounts()
public Integer getUnitQty()
public String getUnitName()
public String getItemCode()
public String getNote()
public Boolean getPrinted()
public Reference getExchangedLineItem()
public String getBinName()
public String getUserData()
public Long getCreatedTime()
public Long getOrderClientCreatedTime()
public List<Discount> getDiscounts()
public List<Discount> getOrderLevelDiscounts()
public Long getDiscountAmount()
public Long getOrderLevelDiscountAmount()
public Boolean getExchanged()
public List<Modification> getModifications()
public Boolean getRefunded()
public Refund getRefund()
public Boolean getIsRevenue()
public List<LineItemPayment> getPayments()
public Long getRevenueAmount()
public Double getQuantitySold()
public Reference getPrintGroup()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullItem()
public boolean isNotNullColorCode()
public boolean isNotNullName()
public boolean isNotNullAlternateName()
public boolean isNotNullPrice()
public boolean isNotNullPriceWithModifiers()
public boolean isNotNullPriceWithModifiersAndItemAndOrderDiscounts()
public boolean isNotNullUnitQty()
public boolean isNotNullUnitName()
public boolean isNotNullItemCode()
public boolean isNotNullNote()
public boolean isNotNullPrinted()
public boolean isNotNullExchangedLineItem()
public boolean isNotNullBinName()
public boolean isNotNullUserData()
public boolean isNotNullCreatedTime()
public boolean isNotNullOrderClientCreatedTime()
public boolean isNotNullDiscounts()
public boolean isNotEmptyDiscounts()
public boolean isNotNullOrderLevelDiscounts()
public boolean isNotEmptyOrderLevelDiscounts()
public boolean isNotNullDiscountAmount()
public boolean isNotNullOrderLevelDiscountAmount()
public boolean isNotNullExchanged()
public boolean isNotNullModifications()
public boolean isNotEmptyModifications()
public boolean isNotNullTags()
public boolean isNotEmptyTags()
public boolean isNotNullRefunded()
public boolean isNotNullRefund()
public boolean isNotNullIsRevenue()
public boolean isNotNullTaxRates()
public boolean isNotEmptyTaxRates()
public boolean isNotNullPayments()
public boolean isNotEmptyPayments()
public boolean isNotNullRevenueAmount()
public boolean isNotNullQuantitySold()
public boolean isNotNullPrintGroup()
public boolean hasId()
public boolean hasItem()
public boolean hasColorCode()
public boolean hasName()
public boolean hasAlternateName()
public boolean hasPrice()
public boolean hasPriceWithModifiers()
public boolean hasPriceWithModifiersAndItemAndOrderDiscounts()
public boolean hasUnitQty()
public boolean hasUnitName()
public boolean hasItemCode()
public boolean hasNote()
public boolean hasPrinted()
public boolean hasExchangedLineItem()
public boolean hasBinName()
public boolean hasUserData()
public boolean hasCreatedTime()
public boolean hasOrderClientCreatedTime()
public boolean hasDiscounts()
public boolean hasOrderLevelDiscounts()
public boolean hasDiscountAmount()
public boolean hasOrderLevelDiscountAmount()
public boolean hasExchanged()
public boolean hasModifications()
public boolean hasTags()
public boolean hasRefunded()
public boolean hasRefund()
public boolean hasIsRevenue()
public boolean hasTaxRates()
public boolean hasPayments()
public boolean hasRevenueAmount()
public boolean hasQuantitySold()
public boolean hasPrintGroup()
public LineItem setItem(Reference item)
public LineItem setAlternateName(String alternateName)
public LineItem setPriceWithModifiers(Long priceWithModifiers)
public LineItem setPriceWithModifiersAndItemAndOrderDiscounts(Long priceWithModifiersAndItemAndOrderDiscounts)
public LineItem setExchangedLineItem(Reference exchangedLineItem)
public LineItem setOrderClientCreatedTime(Long orderClientCreatedTime)
public LineItem setDiscounts(List<Discount> discounts)
public LineItem setOrderLevelDiscounts(List<Discount> orderLevelDiscounts)
public LineItem setDiscountAmount(Long discountAmount)
public LineItem setOrderLevelDiscountAmount(Long orderLevelDiscountAmount)
public LineItem setModifications(List<Modification> modifications)
public LineItem setTags(List<Tag> tags)
public LineItem setRefund(Refund refund)
public LineItem setTaxRates(List<TaxRate> taxRates)
public LineItem setPayments(List<LineItemPayment> payments)
public LineItem setRevenueAmount(Long revenueAmount)
public LineItem setPrintGroup(Reference printGroup)
public void clearId()
public void clearItem()
public void clearColorCode()
public void clearName()
public void clearAlternateName()
public void clearPrice()
public void clearPriceWithModifiers()
public void clearPriceWithModifiersAndItemAndOrderDiscounts()
public void clearUnitQty()
public void clearUnitName()
public void clearItemCode()
public void clearNote()
public void clearPrinted()
public void clearExchangedLineItem()
public void clearBinName()
public void clearUserData()
public void clearCreatedTime()
public void clearOrderClientCreatedTime()
public void clearDiscounts()
public void clearOrderLevelDiscounts()
public void clearDiscountAmount()
public void clearOrderLevelDiscountAmount()
public void clearExchanged()
public void clearModifications()
public void clearTags()
public void clearRefunded()
public void clearRefund()
public void clearIsRevenue()
public void clearTaxRates()
public void clearPayments()
public void clearRevenueAmount()
public void clearQuantitySold()
public void clearPrintGroup()
public boolean containsChanges()
public void resetChangeLog()
public LineItem copyChanges()
public void mergeChanges(LineItem src)