public class AdditionalCharge extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
AdditionalCharge.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<AdditionalCharge> |
CREATOR |
static JSONifiable.Creator<AdditionalCharge> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
AdditionalCharge()
Constructs a new empty instance.
|
|
AdditionalCharge(AdditionalCharge src)
Constructs a new instance that is a deep copy of the source instance.
|
protected |
AdditionalCharge(boolean noInit)
Constructs a new empty instance.
|
|
AdditionalCharge(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.
|
|
AdditionalCharge(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 |
clearDeletedTime()
Clears the 'deletedTime' field, the 'has' method for this field will now return false
|
void |
clearEnabled()
Clears the 'enabled' 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 |
clearIsCashbackOnly()
Clears the 'isCashbackOnly' field, the 'has' method for this field will now return false
|
void |
clearMerchant()
Clears the 'merchant' field, the 'has' method for this field will now return false
|
void |
clearModifiedTime()
Clears the 'modifiedTime' field, the 'has' method for this field will now return false
|
void |
clearPercentageDecimal()
Clears the 'percentageDecimal' field, the 'has' method for this field will now return false
|
void |
clearType()
Clears the 'type' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
AdditionalCharge |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Long |
getAmount()
Optional flat charge amount
|
Long |
getDeletedTime()
Deleted time
|
Boolean |
getEnabled()
If this charge is enabled
|
protected GenericClient |
getGenericClient() |
String |
getId()
Unique identifier
|
Boolean |
getIsCashbackOnly()
If this charge should only apply to transactions with cashback
|
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.
|
Merchant |
getMerchant()
The merchant this charge belongs to
|
Long |
getModifiedTime()
Last modified time
|
Long |
getPercentageDecimal()
Optional percent to charge times 10000, e.g.
|
AdditionalChargeType |
getType()
The type of additional charge
|
boolean |
hasAmount()
Checks whether the 'amount' field has been set, however the value could be null
|
boolean |
hasDeletedTime()
Checks whether the 'deletedTime' field has been set, however the value could be null
|
boolean |
hasEnabled()
Checks whether the 'enabled' 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 |
hasIsCashbackOnly()
Checks whether the 'isCashbackOnly' field has been set, however the value could be null
|
boolean |
hasMerchant()
Checks whether the 'merchant' field has been set, however the value could be null
|
boolean |
hasModifiedTime()
Checks whether the 'modifiedTime' field has been set, however the value could be null
|
boolean |
hasPercentageDecimal()
Checks whether the 'percentageDecimal' field has been set, however the value could be null
|
boolean |
hasType()
Checks whether the 'type' field has been set, however the value could be null
|
boolean |
isNotNullAmount()
Checks whether the 'amount' field is set and is not null
|
boolean |
isNotNullDeletedTime()
Checks whether the 'deletedTime' field is set and is not null
|
boolean |
isNotNullEnabled()
Checks whether the 'enabled' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullIsCashbackOnly()
Checks whether the 'isCashbackOnly' field is set and is not null
|
boolean |
isNotNullMerchant()
Checks whether the 'merchant' field is set and is not null
|
boolean |
isNotNullModifiedTime()
Checks whether the 'modifiedTime' field is set and is not null
|
boolean |
isNotNullPercentageDecimal()
Checks whether the 'percentageDecimal' field is set and is not null
|
boolean |
isNotNullType()
Checks whether the 'type' field is set and is not null
|
void |
mergeChanges(AdditionalCharge 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.
|
AdditionalCharge |
setAmount(Long amount)
Sets the field 'amount'.
|
AdditionalCharge |
setDeletedTime(Long deletedTime)
Sets the field 'deletedTime'.
|
AdditionalCharge |
setEnabled(Boolean enabled)
Sets the field 'enabled'.
|
AdditionalCharge |
setId(String id)
Sets the field 'id'.
|
AdditionalCharge |
setIsCashbackOnly(Boolean isCashbackOnly)
Sets the field 'isCashbackOnly'.
|
AdditionalCharge |
setMerchant(Merchant merchant)
Sets the field 'merchant'.
|
AdditionalCharge |
setModifiedTime(Long modifiedTime)
Sets the field 'modifiedTime'.
|
AdditionalCharge |
setPercentageDecimal(Long percentageDecimal)
Sets the field 'percentageDecimal'.
|
AdditionalCharge |
setType(AdditionalChargeType type)
Sets the field 'type'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<AdditionalCharge> CREATOR
public static final JSONifiable.Creator<AdditionalCharge> JSON_CREATOR
public AdditionalCharge()
protected AdditionalCharge(boolean noInit)
public AdditionalCharge(String json) throws IllegalArgumentException
IllegalArgumentException
public AdditionalCharge(JSONObject jsonObject)
public AdditionalCharge(AdditionalCharge src)
public String getId()
public Merchant getMerchant()
public AdditionalChargeType getType()
public Long getAmount()
public Long getPercentageDecimal()
public Boolean getIsCashbackOnly()
public Boolean getEnabled()
public Long getModifiedTime()
public Long getDeletedTime()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullMerchant()
public boolean isNotNullType()
public boolean isNotNullAmount()
public boolean isNotNullPercentageDecimal()
public boolean isNotNullIsCashbackOnly()
public boolean isNotNullEnabled()
public boolean isNotNullModifiedTime()
public boolean isNotNullDeletedTime()
public boolean hasId()
public boolean hasMerchant()
public boolean hasType()
public boolean hasAmount()
public boolean hasPercentageDecimal()
public boolean hasIsCashbackOnly()
public boolean hasEnabled()
public boolean hasModifiedTime()
public boolean hasDeletedTime()
public AdditionalCharge setId(String id)
public AdditionalCharge setMerchant(Merchant merchant)
public AdditionalCharge setType(AdditionalChargeType type)
public AdditionalCharge setAmount(Long amount)
public AdditionalCharge setPercentageDecimal(Long percentageDecimal)
public AdditionalCharge setIsCashbackOnly(Boolean isCashbackOnly)
public AdditionalCharge setEnabled(Boolean enabled)
public AdditionalCharge setModifiedTime(Long modifiedTime)
public AdditionalCharge setDeletedTime(Long deletedTime)
public void clearId()
public void clearMerchant()
public void clearType()
public void clearAmount()
public void clearPercentageDecimal()
public void clearIsCashbackOnly()
public void clearEnabled()
public void clearModifiedTime()
public void clearDeletedTime()
public boolean containsChanges()
public void resetChangeLog()
public AdditionalCharge copyChanges()
public void mergeChanges(AdditionalCharge src)