public class Modification extends GenericParcelable implements Validator, JSONifiable
Snapshot of a line item modifier at the time that the order was placed.
IOrderService
Modifier and Type | Class and Description |
---|---|
static interface |
Modification.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<Modification> |
CREATOR |
static JSONifiable.Creator<Modification> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
Modification()
Constructs a new empty instance.
|
protected |
Modification(boolean noInit)
Constructs a new empty instance.
|
|
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(Modification src)
Constructs a new instance that is a deep copy of the source instance.
|
|
Modification(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 |
clearAmount()
Clears the 'amount' 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 |
clearModifier()
Clears the 'modifier' 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 |
clearQuantitySold()
Clears the 'quantitySold' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
Modification |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
String |
getAlternateName() |
Long |
getAmount()
the additional cost of the modifier when it was applied
|
protected GenericClient |
getGenericClient() |
String |
getId() |
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.
|
Modifier |
getModifier()
The modifier object.
|
String |
getName()
the name of the modifier when it was applied
|
Long |
getQuantitySold()
This is only used in reports.
|
boolean |
hasAlternateName()
Checks whether the 'alternateName' field has been set, however the value could be null
|
boolean |
hasAmount()
Checks whether the 'amount' 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 |
hasModifier()
Checks whether the 'modifier' 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 |
hasQuantitySold()
Checks whether the 'quantitySold' field has been set, however the value could be null
|
boolean |
isNotNullAlternateName()
Checks whether the 'alternateName' field is set and is not null
|
boolean |
isNotNullAmount()
Checks whether the 'amount' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullModifier()
Checks whether the 'modifier' field is set and is not null
|
boolean |
isNotNullName()
Checks whether the 'name' field is set and is not null
|
boolean |
isNotNullQuantitySold()
Checks whether the 'quantitySold' field is set and is not null
|
void |
mergeChanges(Modification 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.
|
Modification |
setAlternateName(String alternateName)
Sets the field 'alternateName'.
|
Modification |
setAmount(Long amount)
Sets the field 'amount'.
|
Modification |
setId(String id)
Sets the field 'id'.
|
Modification |
setModifier(Modifier modifier)
Sets the field 'modifier'.
|
Modification |
setName(String name)
Sets the field 'name'.
|
Modification |
setQuantitySold(Long quantitySold)
Sets the field 'quantitySold'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<Modification> CREATOR
public static final JSONifiable.Creator<Modification> JSON_CREATOR
public Modification()
protected Modification(boolean noInit)
public Modification(String json) throws IllegalArgumentException
IllegalArgumentException
public Modification(JSONObject jsonObject)
public Modification(Modification src)
public String getId()
public String getName()
public String getAlternateName()
public Long getAmount()
public Modifier getModifier()
public Long getQuantitySold()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullName()
public boolean isNotNullAlternateName()
public boolean isNotNullAmount()
public boolean isNotNullModifier()
public boolean isNotNullQuantitySold()
public boolean hasId()
public boolean hasName()
public boolean hasAlternateName()
public boolean hasAmount()
public boolean hasModifier()
public boolean hasQuantitySold()
public Modification setId(String id)
public Modification setName(String name)
public Modification setAlternateName(String alternateName)
public Modification setAmount(Long amount)
public Modification setModifier(Modifier modifier)
public Modification setQuantitySold(Long quantitySold)
public void clearId()
public void clearName()
public void clearAlternateName()
public void clearAmount()
public void clearModifier()
public void clearQuantitySold()
public boolean containsChanges()
public void resetChangeLog()
public Modification copyChanges()
public void mergeChanges(Modification src)