Class Item

    • Constructor Detail

      • Item

        public Item()
        Constructs a new empty instance.
      • Item

        protected Item​(boolean noInit)
        Constructs a new empty instance.
      • Item

        public 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

        public Item​(Item src)
        Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
    • Method Detail

      • getId

        public String getId()
        Unique identifier
      • getHidden

        public Boolean getHidden()
        True if this item is hidden from Clover Register App
      • getAvailable

        public Boolean getAvailable()
        True if this item is available for sale across all channels
      • getAutoManage

        public Boolean getAutoManage()
        False manually manage item availability, True item availability depends on stock count
      • getItemGroup

        public Reference getItemGroup()
        Reference to an item group
      • getOptions

        public List<Option> getOptions()
        List of options pertaining to this item's attribute variation
      • getName

        public String getName()
        Name of the item
      • getAlternateName

        public String getAlternateName()
        Alternate name of the item
      • getCode

        public String getCode()
        Product code, e.g. UPC or EAN
      • getSku

        public String getSku()
        SKU of the item
      • getPrice

        public Long getPrice()
        Price of the item, typically in cents; use priceType and merchant currency to determine actual item price. For non-VAT merchants, this field is exclusive of tax. For VAT merchants, this field is inclusive of tax.
      • getPriceType

        public PriceType getPriceType()
      • getDefaultTaxRates

        public Boolean getDefaultTaxRates()
        Flag to indicate whether or not to use default tax rates
      • getUnitName

        public String getUnitName()
        Unit name, e.g. oz, lb
      • getCost

        public Long getCost()
        Cost of the item to merchant, as opposed to customer price
      • getIsRevenue

        public Boolean getIsRevenue()
        True if this item should be counted as revenue. For example, gift cards and donations would not be counted as revenue.
      • getStockCount

        @Deprecated
        public Long getStockCount()
        Deprecated.
        Deprecated, use itemStock instead.
      • getCategories

        public List<Category> getCategories()
        Categories associated with this item
      • getTags

        public List<Tag> getTags()
        Tags associated with this item
      • getCanonical

        public Reference getCanonical()
        Reference to canonical items
      • getItemStock

        public ItemStock getItemStock()
        Item stock attribute that can be expanded to show stock quantity
      • getMenuItem

        public MenuItem getMenuItem()
        Menu Item attribute that can be expanded to menu specific attributes
      • getModifiedTime

        public Long getModifiedTime()
      • getDeletedTime

        public Long getDeletedTime()
        Timestamp when item was last deleted
      • getPriceWithoutVat

        public Long getPriceWithoutVat()
        The price without value-added tax (VAT). For non-VAT merchants, this field is ignored. For VAT merchants, this field is the base price of an item.
      • getColorCode

        public String getColorCode()
        Hex code representation of the color assigned to item in the form of #fff, #ffffff, or #ffffffff
      • getJSONObject

        public 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.
        Specified by:
        getJSONObject in interface JSONifiable
      • isNotNullId

        public boolean isNotNullId()
        Checks whether the 'id' field is set and is not null
      • isNotNullHidden

        public boolean isNotNullHidden()
        Checks whether the 'hidden' field is set and is not null
      • isNotNullAvailable

        public boolean isNotNullAvailable()
        Checks whether the 'available' field is set and is not null
      • isNotNullAutoManage

        public boolean isNotNullAutoManage()
        Checks whether the 'autoManage' field is set and is not null
      • isNotNullItemGroup

        public boolean isNotNullItemGroup()
        Checks whether the 'itemGroup' field is set and is not null
      • isNotNullOptions

        public boolean isNotNullOptions()
        Checks whether the 'options' field is set and is not null
      • isNotEmptyOptions

        public boolean isNotEmptyOptions()
        Checks whether the 'options' field is set and is not null and is not empty
      • isNotNullName

        public boolean isNotNullName()
        Checks whether the 'name' field is set and is not null
      • isNotNullAlternateName

        public boolean isNotNullAlternateName()
        Checks whether the 'alternateName' field is set and is not null
      • isNotNullCode

        public boolean isNotNullCode()
        Checks whether the 'code' field is set and is not null
      • isNotNullSku

        public boolean isNotNullSku()
        Checks whether the 'sku' field is set and is not null
      • isNotNullPrice

        public boolean isNotNullPrice()
        Checks whether the 'price' field is set and is not null
      • isNotNullPriceType

        public boolean isNotNullPriceType()
        Checks whether the 'priceType' field is set and is not null
      • isNotNullDefaultTaxRates

        public boolean isNotNullDefaultTaxRates()
        Checks whether the 'defaultTaxRates' field is set and is not null
      • isNotNullUnitName

        public boolean isNotNullUnitName()
        Checks whether the 'unitName' field is set and is not null
      • isNotNullCost

        public boolean isNotNullCost()
        Checks whether the 'cost' field is set and is not null
      • isNotNullIsRevenue

        public boolean isNotNullIsRevenue()
        Checks whether the 'isRevenue' field is set and is not null
      • isNotNullStockCount

        public boolean isNotNullStockCount()
        Checks whether the 'stockCount' field is set and is not null
      • isNotNullTaxRates

        public boolean isNotNullTaxRates()
        Checks whether the 'taxRates' field is set and is not null
      • isNotEmptyTaxRates

        public boolean isNotEmptyTaxRates()
        Checks whether the 'taxRates' field is set and is not null and is not empty
      • isNotNullModifierGroups

        public boolean isNotNullModifierGroups()
        Checks whether the 'modifierGroups' field is set and is not null
      • isNotEmptyModifierGroups

        public boolean isNotEmptyModifierGroups()
        Checks whether the 'modifierGroups' field is set and is not null and is not empty
      • isNotNullCategories

        public boolean isNotNullCategories()
        Checks whether the 'categories' field is set and is not null
      • isNotEmptyCategories

        public boolean isNotEmptyCategories()
        Checks whether the 'categories' field is set and is not null and is not empty
      • isNotNullTags

        public boolean isNotNullTags()
        Checks whether the 'tags' field is set and is not null
      • isNotEmptyTags

        public boolean isNotEmptyTags()
        Checks whether the 'tags' field is set and is not null and is not empty
      • isNotNullCanonical

        public boolean isNotNullCanonical()
        Checks whether the 'canonical' field is set and is not null
      • isNotNullItemStock

        public boolean isNotNullItemStock()
        Checks whether the 'itemStock' field is set and is not null
      • isNotNullMenuItem

        public boolean isNotNullMenuItem()
        Checks whether the 'menuItem' field is set and is not null
      • isNotNullModifiedTime

        public boolean isNotNullModifiedTime()
        Checks whether the 'modifiedTime' field is set and is not null
      • isNotNullDeletedTime

        public boolean isNotNullDeletedTime()
        Checks whether the 'deletedTime' field is set and is not null
      • isNotNullPriceWithoutVat

        public boolean isNotNullPriceWithoutVat()
        Checks whether the 'priceWithoutVat' field is set and is not null
      • isNotNullColorCode

        public boolean isNotNullColorCode()
        Checks whether the 'colorCode' field is set and is not null
      • hasId

        public boolean hasId()
        Checks whether the 'id' field has been set, however the value could be null
      • hasHidden

        public boolean hasHidden()
        Checks whether the 'hidden' field has been set, however the value could be null
      • hasAvailable

        public boolean hasAvailable()
        Checks whether the 'available' field has been set, however the value could be null
      • hasAutoManage

        public boolean hasAutoManage()
        Checks whether the 'autoManage' field has been set, however the value could be null
      • hasItemGroup

        public boolean hasItemGroup()
        Checks whether the 'itemGroup' field has been set, however the value could be null
      • hasOptions

        public boolean hasOptions()
        Checks whether the 'options' field has been set, however the value could be null
      • hasName

        public boolean hasName()
        Checks whether the 'name' field has been set, however the value could be null
      • hasAlternateName

        public boolean hasAlternateName()
        Checks whether the 'alternateName' field has been set, however the value could be null
      • hasCode

        public boolean hasCode()
        Checks whether the 'code' field has been set, however the value could be null
      • hasSku

        public boolean hasSku()
        Checks whether the 'sku' field has been set, however the value could be null
      • hasPrice

        public boolean hasPrice()
        Checks whether the 'price' field has been set, however the value could be null
      • hasPriceType

        public boolean hasPriceType()
        Checks whether the 'priceType' field has been set, however the value could be null
      • hasDefaultTaxRates

        public boolean hasDefaultTaxRates()
        Checks whether the 'defaultTaxRates' field has been set, however the value could be null
      • hasUnitName

        public boolean hasUnitName()
        Checks whether the 'unitName' field has been set, however the value could be null
      • hasCost

        public boolean hasCost()
        Checks whether the 'cost' field has been set, however the value could be null
      • hasIsRevenue

        public boolean hasIsRevenue()
        Checks whether the 'isRevenue' field has been set, however the value could be null
      • hasStockCount

        public boolean hasStockCount()
        Checks whether the 'stockCount' field has been set, however the value could be null
      • hasTaxRates

        public boolean hasTaxRates()
        Checks whether the 'taxRates' field has been set, however the value could be null
      • hasModifierGroups

        public boolean hasModifierGroups()
        Checks whether the 'modifierGroups' field has been set, however the value could be null
      • hasCategories

        public boolean hasCategories()
        Checks whether the 'categories' field has been set, however the value could be null
      • hasTags

        public boolean hasTags()
        Checks whether the 'tags' field has been set, however the value could be null
      • hasCanonical

        public boolean hasCanonical()
        Checks whether the 'canonical' field has been set, however the value could be null
      • hasItemStock

        public boolean hasItemStock()
        Checks whether the 'itemStock' field has been set, however the value could be null
      • hasMenuItem

        public boolean hasMenuItem()
        Checks whether the 'menuItem' field has been set, however the value could be null
      • hasModifiedTime

        public boolean hasModifiedTime()
        Checks whether the 'modifiedTime' field has been set, however the value could be null
      • hasDeletedTime

        public boolean hasDeletedTime()
        Checks whether the 'deletedTime' field has been set, however the value could be null
      • hasPriceWithoutVat

        public boolean hasPriceWithoutVat()
        Checks whether the 'priceWithoutVat' field has been set, however the value could be null
      • hasColorCode

        public boolean hasColorCode()
        Checks whether the 'colorCode' field has been set, however the value could be null
      • setId

        public Item setId​(String id)
        Sets the field 'id'.
      • setHidden

        public Item setHidden​(Boolean hidden)
        Sets the field 'hidden'.
      • setAvailable

        public Item setAvailable​(Boolean available)
        Sets the field 'available'.
      • setAutoManage

        public Item setAutoManage​(Boolean autoManage)
        Sets the field 'autoManage'.
      • setItemGroup

        public Item setItemGroup​(Reference itemGroup)
        Sets the field 'itemGroup'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setOptions

        public Item setOptions​(List<Option> options)
        Sets the field 'options'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • setName

        public Item setName​(String name)
        Sets the field 'name'.
      • setAlternateName

        public Item setAlternateName​(String alternateName)
        Sets the field 'alternateName'.
      • setCode

        public Item setCode​(String code)
        Sets the field 'code'.
      • setSku

        public Item setSku​(String sku)
        Sets the field 'sku'.
      • setPrice

        public Item setPrice​(Long price)
        Sets the field 'price'.
      • setPriceType

        public Item setPriceType​(PriceType priceType)
        Sets the field 'priceType'.
      • setDefaultTaxRates

        public Item setDefaultTaxRates​(Boolean defaultTaxRates)
        Sets the field 'defaultTaxRates'.
      • setUnitName

        public Item setUnitName​(String unitName)
        Sets the field 'unitName'.
      • setCost

        public Item setCost​(Long cost)
        Sets the field 'cost'.
      • setIsRevenue

        public Item setIsRevenue​(Boolean isRevenue)
        Sets the field 'isRevenue'.
      • setStockCount

        public Item setStockCount​(Long stockCount)
        Sets the field 'stockCount'.
      • setTaxRates

        public Item setTaxRates​(List<TaxRate> taxRates)
        Sets the field 'taxRates'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • setModifierGroups

        public Item setModifierGroups​(List<ModifierGroup> modifierGroups)
        Sets the field 'modifierGroups'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • setCategories

        public Item setCategories​(List<Category> categories)
        Sets the field 'categories'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • setTags

        public Item setTags​(List<Tag> tags)
        Sets the field 'tags'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • setCanonical

        public Item setCanonical​(Reference canonical)
        Sets the field 'canonical'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setItemStock

        public Item setItemStock​(ItemStock itemStock)
        Sets the field 'itemStock'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setMenuItem

        public Item setMenuItem​(MenuItem menuItem)
        Sets the field 'menuItem'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setModifiedTime

        public Item setModifiedTime​(Long modifiedTime)
        Sets the field 'modifiedTime'.
      • setDeletedTime

        public Item setDeletedTime​(Long deletedTime)
        Sets the field 'deletedTime'.
      • setPriceWithoutVat

        public Item setPriceWithoutVat​(Long priceWithoutVat)
        Sets the field 'priceWithoutVat'.
      • setColorCode

        public Item setColorCode​(String colorCode)
        Sets the field 'colorCode'.
      • clearId

        public void clearId()
        Clears the 'id' field, the 'has' method for this field will now return false
      • clearHidden

        public void clearHidden()
        Clears the 'hidden' field, the 'has' method for this field will now return false
      • clearAvailable

        public void clearAvailable()
        Clears the 'available' field, the 'has' method for this field will now return false
      • clearAutoManage

        public void clearAutoManage()
        Clears the 'autoManage' field, the 'has' method for this field will now return false
      • clearItemGroup

        public void clearItemGroup()
        Clears the 'itemGroup' field, the 'has' method for this field will now return false
      • clearOptions

        public void clearOptions()
        Clears the 'options' field, the 'has' method for this field will now return false
      • clearName

        public void clearName()
        Clears the 'name' field, the 'has' method for this field will now return false
      • clearAlternateName

        public void clearAlternateName()
        Clears the 'alternateName' field, the 'has' method for this field will now return false
      • clearCode

        public void clearCode()
        Clears the 'code' field, the 'has' method for this field will now return false
      • clearSku

        public void clearSku()
        Clears the 'sku' field, the 'has' method for this field will now return false
      • clearPrice

        public void clearPrice()
        Clears the 'price' field, the 'has' method for this field will now return false
      • clearPriceType

        public void clearPriceType()
        Clears the 'priceType' field, the 'has' method for this field will now return false
      • clearDefaultTaxRates

        public void clearDefaultTaxRates()
        Clears the 'defaultTaxRates' field, the 'has' method for this field will now return false
      • clearUnitName

        public void clearUnitName()
        Clears the 'unitName' field, the 'has' method for this field will now return false
      • clearCost

        public void clearCost()
        Clears the 'cost' field, the 'has' method for this field will now return false
      • clearIsRevenue

        public void clearIsRevenue()
        Clears the 'isRevenue' field, the 'has' method for this field will now return false
      • clearStockCount

        public void clearStockCount()
        Clears the 'stockCount' field, the 'has' method for this field will now return false
      • clearTaxRates

        public void clearTaxRates()
        Clears the 'taxRates' field, the 'has' method for this field will now return false
      • clearModifierGroups

        public void clearModifierGroups()
        Clears the 'modifierGroups' field, the 'has' method for this field will now return false
      • clearCategories

        public void clearCategories()
        Clears the 'categories' field, the 'has' method for this field will now return false
      • clearTags

        public void clearTags()
        Clears the 'tags' field, the 'has' method for this field will now return false
      • clearCanonical

        public void clearCanonical()
        Clears the 'canonical' field, the 'has' method for this field will now return false
      • clearItemStock

        public void clearItemStock()
        Clears the 'itemStock' field, the 'has' method for this field will now return false
      • clearMenuItem

        public void clearMenuItem()
        Clears the 'menuItem' field, the 'has' method for this field will now return false
      • clearModifiedTime

        public void clearModifiedTime()
        Clears the 'modifiedTime' field, the 'has' method for this field will now return false
      • clearDeletedTime

        public void clearDeletedTime()
        Clears the 'deletedTime' field, the 'has' method for this field will now return false
      • clearPriceWithoutVat

        public void clearPriceWithoutVat()
        Clears the 'priceWithoutVat' field, the 'has' method for this field will now return false
      • clearColorCode

        public void clearColorCode()
        Clears the 'colorCode' field, the 'has' method for this field will now return false
      • containsChanges

        public boolean containsChanges()
        Returns true if this instance has any changes.
      • resetChangeLog

        public void resetChangeLog()
        Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
      • copyChanges

        public Item copyChanges()
        Create a copy of this instance that contains only fields that were set after the constructor was called.
      • mergeChanges

        public void mergeChanges​(Item src)
        Copy all the changed fields from the given source to this instance.