public class DisplayDiscount extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
DisplayDiscount.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<DisplayDiscount> |
CREATOR |
static JSONifiable.Creator<DisplayDiscount> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
DisplayDiscount()
Constructs a new empty instance.
|
protected |
DisplayDiscount(boolean noInit)
Constructs a new empty instance.
|
|
DisplayDiscount(DisplayDiscount src)
Constructs a new instance that is a deep copy of the source instance.
|
|
DisplayDiscount(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.
|
|
DisplayDiscount(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
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 |
clearLineItemId()
Clears the 'lineItemId' 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 |
clearPercentage()
Clears the 'percentage' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
DisplayDiscount |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
String |
getAmount()
Formatted discount amount
|
protected GenericClient |
getGenericClient() |
String |
getId()
Unique identifier
|
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.
|
String |
getLineItemId()
The lineItem with which the discount is associated
|
String |
getName()
Name of the discount
|
String |
getPercentage()
Discount amount in percent
|
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 |
hasLineItemId()
Checks whether the 'lineItemId' 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 |
hasPercentage()
Checks whether the 'percentage' field has been set, however the value could be 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 |
isNotNullLineItemId()
Checks whether the 'lineItemId' field is set and is not null
|
boolean |
isNotNullName()
Checks whether the 'name' field is set and is not null
|
boolean |
isNotNullPercentage()
Checks whether the 'percentage' field is set and is not null
|
void |
mergeChanges(DisplayDiscount 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.
|
DisplayDiscount |
setAmount(String amount)
Sets the field 'amount'.
|
DisplayDiscount |
setId(String id)
Sets the field 'id'.
|
DisplayDiscount |
setLineItemId(String lineItemId)
Sets the field 'lineItemId'.
|
DisplayDiscount |
setName(String name)
Sets the field 'name'.
|
DisplayDiscount |
setPercentage(String percentage)
Sets the field 'percentage'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<DisplayDiscount> CREATOR
public static final JSONifiable.Creator<DisplayDiscount> JSON_CREATOR
public DisplayDiscount()
protected DisplayDiscount(boolean noInit)
public DisplayDiscount(String json) throws IllegalArgumentException
IllegalArgumentException
public DisplayDiscount(JSONObject jsonObject)
public DisplayDiscount(DisplayDiscount src)
public String getId()
public String getLineItemId()
public String getName()
public String getAmount()
public String getPercentage()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullLineItemId()
public boolean isNotNullName()
public boolean isNotNullAmount()
public boolean isNotNullPercentage()
public boolean hasId()
public boolean hasLineItemId()
public boolean hasName()
public boolean hasAmount()
public boolean hasPercentage()
public DisplayDiscount setId(String id)
public DisplayDiscount setLineItemId(String lineItemId)
public DisplayDiscount setName(String name)
public DisplayDiscount setAmount(String amount)
public DisplayDiscount setPercentage(String percentage)
public void clearId()
public void clearLineItemId()
public void clearName()
public void clearAmount()
public void clearPercentage()
public boolean containsChanges()
public void resetChangeLog()
public DisplayDiscount copyChanges()
public void mergeChanges(DisplayDiscount src)