public class Item extends GenericParcelable implements Validator, JSONifiable
IInventoryService
Modifier and Type | Class and Description |
---|---|
static interface |
Item.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static String |
AUTHORITY |
static Parcelable.Creator<Item> |
CREATOR |
static JSONifiable.Creator<Item> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
Item()
Constructs a new empty instance.
|
protected |
Item(boolean noInit)
Constructs a new empty instance.
|
|
Item(Item src)
Constructs a new instance that is a deep copy of the source instance.
|
|
Item(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.
|
|
Item(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 |
clearAutoManage()
Clears the 'autoManage' field, the 'has' method for this field will now return false
|
void |
clearAvailable()
Clears the 'available' field, the 'has' method for this field will now return false
|
void |
clearCanonical()
Clears the 'canonical' field, the 'has' method for this field will now return false
|
void |
clearCategories()
Clears the 'categories' field, the 'has' method for this field will now return false
|
void |
clearCode()
Clears the 'code' 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 |
clearCost()
Clears the 'cost' field, the 'has' method for this field will now return false
|
void |
clearDefaultTaxRates()
Clears the 'defaultTaxRates' field, the 'has' method for this field will now return false
|
void |
clearDeletedTime()
Clears the 'deletedTime' field, the 'has' method for this field will now return false
|
void |
clearHidden()
Clears the 'hidden' 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 |
clearItemGroup()
Clears the 'itemGroup' field, the 'has' method for this field will now return false
|
void |
clearItemStock()
Clears the 'itemStock' field, the 'has' method for this field will now return false
|
void |
clearMenuItem()
Clears the 'menuItem' field, the 'has' method for this field will now return false
|
void |
clearModifiedTime()
Clears the 'modifiedTime' field, the 'has' method for this field will now return false
|
void |
clearModifierGroups()
Clears the 'modifierGroups' 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 |
clearOptions()
Clears the 'options' 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 |
clearPriceType()
Clears the 'priceType' field, the 'has' method for this field will now return false
|
void |
clearPriceWithoutVat()
Clears the 'priceWithoutVat' field, the 'has' method for this field will now return false
|
void |
clearSku()
Clears the 'sku' field, the 'has' method for this field will now return false
|
void |
clearStockCount()
Clears the 'stockCount' 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
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
Item |
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 item
|
Boolean |
getAutoManage()
False manually manage item availability, True item availability depends on stock count
|
Boolean |
getAvailable()
True if this item is available for sale across all channels
|
Reference |
getCanonical()
Reference to canonical items
|
List<Category> |
getCategories()
Categories associated with this item
|
String |
getCode()
Product code, e.g.
|
String |
getColorCode()
Hex code representation of the color assigned to item in the form of #fff, #ffffff, or #ffffffff
|
Long |
getCost()
Cost of the item to merchant, as opposed to customer price
|
Boolean |
getDefaultTaxRates()
Flag to indicate whether or not to use default tax rates
|
Long |
getDeletedTime()
Timestamp when item was last deleted
|
protected GenericClient |
getGenericClient() |
Boolean |
getHidden()
True if this item is hidden from Clover Register App
|
String |
getId()
Unique identifier
|
Boolean |
getIsRevenue()
True if this item should be counted as revenue.
|
Reference |
getItemGroup()
Reference to an item group
|
ItemStock |
getItemStock()
Item stock attribute that can be expanded to show stock quantity
|
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.
|
MenuItem |
getMenuItem()
Menu Item attribute that can be expanded to menu specific attributes
|
Long |
getModifiedTime() |
List<ModifierGroup> |
getModifierGroups() |
String |
getName()
Name of the item
|
List<Option> |
getOptions()
List of options pertaining to this item's attribute variation
|
Long |
getPrice()
Price of the item, typically in cents; use priceType and merchant currency to determine actual item price.
|
PriceType |
getPriceType() |
Long |
getPriceWithoutVat()
The price without value-added tax (VAT).
|
String |
getSku()
SKU of the item
|
Long |
getStockCount()
Deprecated.
|
List<Tag> |
getTags()
Tags associated with this item
|
List<TaxRate> |
getTaxRates() |
String |
getUnitName()
Unit name, e.g.
|
boolean |
hasAlternateName()
Checks whether the 'alternateName' field has been set, however the value could be null
|
boolean |
hasAutoManage()
Checks whether the 'autoManage' field has been set, however the value could be null
|
boolean |
hasAvailable()
Checks whether the 'available' field has been set, however the value could be null
|
boolean |
hasCanonical()
Checks whether the 'canonical' field has been set, however the value could be null
|
boolean |
hasCategories()
Checks whether the 'categories' field has been set, however the value could be null
|
boolean |
hasCode()
Checks whether the 'code' 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 |
hasCost()
Checks whether the 'cost' field has been set, however the value could be null
|
boolean |
hasDefaultTaxRates()
Checks whether the 'defaultTaxRates' field has been set, however the value could be null
|
boolean |
hasDeletedTime()
Checks whether the 'deletedTime' field has been set, however the value could be null
|
boolean |
hasHidden()
Checks whether the 'hidden' 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 |
hasItemGroup()
Checks whether the 'itemGroup' field has been set, however the value could be null
|
boolean |
hasItemStock()
Checks whether the 'itemStock' field has been set, however the value could be null
|
boolean |
hasMenuItem()
Checks whether the 'menuItem' field has been set, however the value could be null
|
boolean |
hasModifiedTime()
Checks whether the 'modifiedTime' field has been set, however the value could be null
|
boolean |
hasModifierGroups()
Checks whether the 'modifierGroups' 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 |
hasOptions()
Checks whether the 'options' 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 |
hasPriceType()
Checks whether the 'priceType' field has been set, however the value could be null
|
boolean |
hasPriceWithoutVat()
Checks whether the 'priceWithoutVat' field has been set, however the value could be null
|
boolean |
hasSku()
Checks whether the 'sku' field has been set, however the value could be null
|
boolean |
hasStockCount()
Checks whether the 'stockCount' 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 |
isNotEmptyCategories()
Checks whether the 'categories' field is set and is not null and is not empty
|
boolean |
isNotEmptyModifierGroups()
Checks whether the 'modifierGroups' field is set and is not null and is not empty
|
boolean |
isNotEmptyOptions()
Checks whether the 'options' 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 |
isNotNullAutoManage()
Checks whether the 'autoManage' field is set and is not null
|
boolean |
isNotNullAvailable()
Checks whether the 'available' field is set and is not null
|
boolean |
isNotNullCanonical()
Checks whether the 'canonical' field is set and is not null
|
boolean |
isNotNullCategories()
Checks whether the 'categories' field is set and is not null
|
boolean |
isNotNullCode()
Checks whether the 'code' field is set and is not null
|
boolean |
isNotNullColorCode()
Checks whether the 'colorCode' field is set and is not null
|
boolean |
isNotNullCost()
Checks whether the 'cost' field is set and is not null
|
boolean |
isNotNullDefaultTaxRates()
Checks whether the 'defaultTaxRates' field is set and is not null
|
boolean |
isNotNullDeletedTime()
Checks whether the 'deletedTime' field is set and is not null
|
boolean |
isNotNullHidden()
Checks whether the 'hidden' 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 |
isNotNullItemGroup()
Checks whether the 'itemGroup' field is set and is not null
|
boolean |
isNotNullItemStock()
Checks whether the 'itemStock' field is set and is not null
|
boolean |
isNotNullMenuItem()
Checks whether the 'menuItem' field is set and is not null
|
boolean |
isNotNullModifiedTime()
Checks whether the 'modifiedTime' field is set and is not null
|
boolean |
isNotNullModifierGroups()
Checks whether the 'modifierGroups' field is set and is not null
|
boolean |
isNotNullName()
Checks whether the 'name' field is set and is not null
|
boolean |
isNotNullOptions()
Checks whether the 'options' field is set and is not null
|
boolean |
isNotNullPrice()
Checks whether the 'price' field is set and is not null
|
boolean |
isNotNullPriceType()
Checks whether the 'priceType' field is set and is not null
|
boolean |
isNotNullPriceWithoutVat()
Checks whether the 'priceWithoutVat' field is set and is not null
|
boolean |
isNotNullSku()
Checks whether the 'sku' field is set and is not null
|
boolean |
isNotNullStockCount()
Checks whether the 'stockCount' 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
|
void |
mergeChanges(Item 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.
|
Item |
setAlternateName(String alternateName)
Sets the field 'alternateName'.
|
Item |
setAutoManage(Boolean autoManage)
Sets the field 'autoManage'.
|
Item |
setAvailable(Boolean available)
Sets the field 'available'.
|
Item |
setCanonical(Reference canonical)
Sets the field 'canonical'.
|
Item |
setCategories(List<Category> categories)
Sets the field 'categories'.
|
Item |
setCode(String code)
Sets the field 'code'.
|
Item |
setColorCode(String colorCode)
Sets the field 'colorCode'.
|
Item |
setCost(Long cost)
Sets the field 'cost'.
|
Item |
setDefaultTaxRates(Boolean defaultTaxRates)
Sets the field 'defaultTaxRates'.
|
Item |
setDeletedTime(Long deletedTime)
Sets the field 'deletedTime'.
|
Item |
setHidden(Boolean hidden)
Sets the field 'hidden'.
|
Item |
setId(String id)
Sets the field 'id'.
|
Item |
setIsRevenue(Boolean isRevenue)
Sets the field 'isRevenue'.
|
Item |
setItemGroup(Reference itemGroup)
Sets the field 'itemGroup'.
|
Item |
setItemStock(ItemStock itemStock)
Sets the field 'itemStock'.
|
Item |
setMenuItem(MenuItem menuItem)
Sets the field 'menuItem'.
|
Item |
setModifiedTime(Long modifiedTime)
Sets the field 'modifiedTime'.
|
Item |
setModifierGroups(List<ModifierGroup> modifierGroups)
Sets the field 'modifierGroups'.
|
Item |
setName(String name)
Sets the field 'name'.
|
Item |
setOptions(List<Option> options)
Sets the field 'options'.
|
Item |
setPrice(Long price)
Sets the field 'price'.
|
Item |
setPriceType(PriceType priceType)
Sets the field 'priceType'.
|
Item |
setPriceWithoutVat(Long priceWithoutVat)
Sets the field 'priceWithoutVat'.
|
Item |
setSku(String sku)
Sets the field 'sku'.
|
Item |
setStockCount(Long stockCount)
Sets the field 'stockCount'.
|
Item |
setTags(List<Tag> tags)
Sets the field 'tags'.
|
Item |
setTaxRates(List<TaxRate> taxRates)
Sets the field 'taxRates'.
|
Item |
setUnitName(String unitName)
Sets the field 'unitName'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final String AUTHORITY
public static final Parcelable.Creator<Item> CREATOR
public static final JSONifiable.Creator<Item> JSON_CREATOR
public Item()
protected Item(boolean noInit)
public Item(String json) throws IllegalArgumentException
IllegalArgumentException
public Item(JSONObject jsonObject)
public Item(Item src)
public String getId()
public Boolean getHidden()
public Boolean getAvailable()
public Boolean getAutoManage()
public Reference getItemGroup()
public List<Option> getOptions()
public String getName()
public String getAlternateName()
public String getCode()
public String getSku()
public Long getPrice()
public PriceType getPriceType()
public Boolean getDefaultTaxRates()
public String getUnitName()
public Long getCost()
public Boolean getIsRevenue()
@Deprecated public Long getStockCount()
public List<ModifierGroup> getModifierGroups()
public Reference getCanonical()
public ItemStock getItemStock()
public MenuItem getMenuItem()
public Long getModifiedTime()
public Long getDeletedTime()
public Long getPriceWithoutVat()
public String getColorCode()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullHidden()
public boolean isNotNullAvailable()
public boolean isNotNullAutoManage()
public boolean isNotNullItemGroup()
public boolean isNotNullOptions()
public boolean isNotEmptyOptions()
public boolean isNotNullName()
public boolean isNotNullAlternateName()
public boolean isNotNullCode()
public boolean isNotNullSku()
public boolean isNotNullPrice()
public boolean isNotNullPriceType()
public boolean isNotNullDefaultTaxRates()
public boolean isNotNullUnitName()
public boolean isNotNullCost()
public boolean isNotNullIsRevenue()
public boolean isNotNullStockCount()
public boolean isNotNullTaxRates()
public boolean isNotEmptyTaxRates()
public boolean isNotNullModifierGroups()
public boolean isNotEmptyModifierGroups()
public boolean isNotNullCategories()
public boolean isNotEmptyCategories()
public boolean isNotNullTags()
public boolean isNotEmptyTags()
public boolean isNotNullCanonical()
public boolean isNotNullItemStock()
public boolean isNotNullMenuItem()
public boolean isNotNullModifiedTime()
public boolean isNotNullDeletedTime()
public boolean isNotNullPriceWithoutVat()
public boolean isNotNullColorCode()
public boolean hasId()
public boolean hasHidden()
public boolean hasAvailable()
public boolean hasAutoManage()
public boolean hasItemGroup()
public boolean hasOptions()
public boolean hasName()
public boolean hasAlternateName()
public boolean hasCode()
public boolean hasSku()
public boolean hasPrice()
public boolean hasPriceType()
public boolean hasDefaultTaxRates()
public boolean hasUnitName()
public boolean hasCost()
public boolean hasIsRevenue()
public boolean hasStockCount()
public boolean hasTaxRates()
public boolean hasModifierGroups()
public boolean hasCategories()
public boolean hasTags()
public boolean hasCanonical()
public boolean hasItemStock()
public boolean hasMenuItem()
public boolean hasModifiedTime()
public boolean hasDeletedTime()
public boolean hasPriceWithoutVat()
public boolean hasColorCode()
public Item setItemGroup(Reference itemGroup)
public Item setOptions(List<Option> options)
public Item setDefaultTaxRates(Boolean defaultTaxRates)
public Item setTaxRates(List<TaxRate> taxRates)
public Item setModifierGroups(List<ModifierGroup> modifierGroups)
public Item setCategories(List<Category> categories)
public Item setTags(List<Tag> tags)
public Item setCanonical(Reference canonical)
public Item setItemStock(ItemStock itemStock)
public Item setMenuItem(MenuItem menuItem)
public Item setPriceWithoutVat(Long priceWithoutVat)
public void clearId()
public void clearHidden()
public void clearAvailable()
public void clearAutoManage()
public void clearItemGroup()
public void clearOptions()
public void clearName()
public void clearAlternateName()
public void clearCode()
public void clearSku()
public void clearPrice()
public void clearPriceType()
public void clearDefaultTaxRates()
public void clearUnitName()
public void clearCost()
public void clearIsRevenue()
public void clearStockCount()
public void clearTaxRates()
public void clearModifierGroups()
public void clearCategories()
public void clearTags()
public void clearCanonical()
public void clearItemStock()
public void clearMenuItem()
public void clearModifiedTime()
public void clearDeletedTime()
public void clearPriceWithoutVat()
public void clearColorCode()
public boolean containsChanges()
public void resetChangeLog()
public Item copyChanges()
public void mergeChanges(Item src)