Class ItemStock

    • Constructor Detail

      • ItemStock

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

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

        public ItemStock​(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.
      • ItemStock

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

      • getItem

        public Reference getItem()
        Reference to an item
      • getStockCount

        @Deprecated
        public Long getStockCount()
        Deprecated.
        Deprecated, use quantity instead.
      • getQuantity

        public Double getQuantity()
        Current count of this item in stock.
      • getModifiedTime

        public Long getModifiedTime()
      • 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
      • isNotNullItem

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

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

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

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

        public boolean hasItem()
        Checks whether the 'item' 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
      • hasQuantity

        public boolean hasQuantity()
        Checks whether the 'quantity' 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
      • setItem

        public ItemStock setItem​(Reference item)
        Sets the field 'item'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setStockCount

        public ItemStock setStockCount​(Long stockCount)
        Sets the field 'stockCount'.
      • setQuantity

        public ItemStock setQuantity​(Double quantity)
        Sets the field 'quantity'.
      • setModifiedTime

        public ItemStock setModifiedTime​(Long modifiedTime)
        Sets the field 'modifiedTime'.
      • clearItem

        public void clearItem()
        Clears the 'item' 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
      • clearQuantity

        public void clearQuantity()
        Clears the 'quantity' 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
      • 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 ItemStock copyChanges()
        Create a copy of this instance that contains only fields that were set after the constructor was called.
      • mergeChanges

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