Class Modification

    • Constructor Detail

      • Modification

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

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

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

        public Modification​(Modification 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()
      • getName

        public String getName()
        the name of the modifier when it was applied
      • getAlternateName

        public String getAlternateName()
      • getAmount

        public Long getAmount()
        the additional cost of the modifier when it was applied
      • getModifier

        public Modifier getModifier()
        The modifier object. Values from the Modifier are copied to the Modification at the time that the order is placed. Modifier values may change after the modification is created.
      • getQuantitySold

        public Long getQuantitySold()
        This is only used in reports. The count of how many of these modifiers that were sold.
      • 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
      • 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
      • isNotNullAmount

        public boolean isNotNullAmount()
        Checks whether the 'amount' field is set and is not null
      • isNotNullModifier

        public boolean isNotNullModifier()
        Checks whether the 'modifier' field is set and is not null
      • isNotNullQuantitySold

        public boolean isNotNullQuantitySold()
        Checks whether the 'quantitySold' 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
      • 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
      • hasAmount

        public boolean hasAmount()
        Checks whether the 'amount' field has been set, however the value could be null
      • hasModifier

        public boolean hasModifier()
        Checks whether the 'modifier' field has been set, however the value could be null
      • hasQuantitySold

        public boolean hasQuantitySold()
        Checks whether the 'quantitySold' field has been set, however the value could be null
      • setAlternateName

        public Modification setAlternateName​(String alternateName)
        Sets the field 'alternateName'.
      • setAmount

        public Modification setAmount​(Long amount)
        Sets the field 'amount'.
      • setModifier

        public Modification setModifier​(Modifier modifier)
        Sets the field 'modifier'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • setQuantitySold

        public Modification setQuantitySold​(Long quantitySold)
        Sets the field 'quantitySold'.
      • clearId

        public void clearId()
        Clears the 'id' 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
      • clearAmount

        public void clearAmount()
        Clears the 'amount' field, the 'has' method for this field will now return false
      • clearModifier

        public void clearModifier()
        Clears the 'modifier' field, the 'has' method for this field will now return false
      • clearQuantitySold

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

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