public class DisplayPayment extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
DisplayPayment.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<DisplayPayment> |
CREATOR |
static JSONifiable.Creator<DisplayPayment> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
DisplayPayment()
Constructs a new empty instance.
|
protected |
DisplayPayment(boolean noInit)
Constructs a new empty instance.
|
|
DisplayPayment(DisplayPayment src)
Constructs a new instance that is a deep copy of the source instance.
|
|
DisplayPayment(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.
|
|
DisplayPayment(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 |
clearLabel()
Clears the 'label' field, the 'has' method for this field will now return false
|
void |
clearTaxAmount()
Clears the 'taxAmount' field, the 'has' method for this field will now return false
|
void |
clearTipAmount()
Clears the 'tipAmount' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
DisplayPayment |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
String |
getAmount()
Formatted total amount paid
|
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 |
getLabel()
Formatted display string for the tender e.g.
|
Long |
getTaxAmount()
Formatted amount paid in tax
|
String |
getTipAmount()
Formatted amount paid in tips
|
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 |
hasLabel()
Checks whether the 'label' field has been set, however the value could be null
|
boolean |
hasTaxAmount()
Checks whether the 'taxAmount' field has been set, however the value could be null
|
boolean |
hasTipAmount()
Checks whether the 'tipAmount' 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 |
isNotNullLabel()
Checks whether the 'label' field is set and is not null
|
boolean |
isNotNullTaxAmount()
Checks whether the 'taxAmount' field is set and is not null
|
boolean |
isNotNullTipAmount()
Checks whether the 'tipAmount' field is set and is not null
|
void |
mergeChanges(DisplayPayment 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.
|
DisplayPayment |
setAmount(String amount)
Sets the field 'amount'.
|
DisplayPayment |
setId(String id)
Sets the field 'id'.
|
DisplayPayment |
setLabel(String label)
Sets the field 'label'.
|
DisplayPayment |
setTaxAmount(Long taxAmount)
Sets the field 'taxAmount'.
|
DisplayPayment |
setTipAmount(String tipAmount)
Sets the field 'tipAmount'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<DisplayPayment> CREATOR
public static final JSONifiable.Creator<DisplayPayment> JSON_CREATOR
public DisplayPayment()
protected DisplayPayment(boolean noInit)
public DisplayPayment(String json) throws IllegalArgumentException
IllegalArgumentException
public DisplayPayment(JSONObject jsonObject)
public DisplayPayment(DisplayPayment src)
public String getId()
public String getLabel()
public String getAmount()
public String getTipAmount()
public Long getTaxAmount()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullLabel()
public boolean isNotNullAmount()
public boolean isNotNullTipAmount()
public boolean isNotNullTaxAmount()
public boolean hasId()
public boolean hasLabel()
public boolean hasAmount()
public boolean hasTipAmount()
public boolean hasTaxAmount()
public DisplayPayment setId(String id)
public DisplayPayment setLabel(String label)
public DisplayPayment setAmount(String amount)
public DisplayPayment setTipAmount(String tipAmount)
public DisplayPayment setTaxAmount(Long taxAmount)
public void clearId()
public void clearLabel()
public void clearAmount()
public void clearTipAmount()
public void clearTaxAmount()
public boolean containsChanges()
public void resetChangeLog()
public DisplayPayment copyChanges()
public void mergeChanges(DisplayPayment src)