public class Transaction extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
Transaction.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<Transaction> |
CREATOR |
static JSONifiable.Creator<Transaction> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
Transaction()
Constructs a new empty instance.
|
protected |
Transaction(boolean noInit)
Constructs a new empty instance.
|
|
Transaction(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.
|
|
Transaction(String json)
Constructs a new instance from the given JSON String.
|
|
Transaction(Transaction src)
Constructs a new instance that is a deep copy of the source instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clearClientCreatedTime()
Clears the 'clientCreatedTime' field, the 'has' method for this field will now return false
|
void |
clearCreatedTime()
Clears the 'createdTime' field, the 'has' method for this field will now return false
|
void |
clearCredit()
Clears the 'credit' field, the 'has' method for this field will now return false
|
void |
clearCreditRefund()
Clears the 'creditRefund' field, the 'has' method for this field will now return false
|
void |
clearPayment()
Clears the 'payment' field, the 'has' method for this field will now return false
|
void |
clearRefund()
Clears the 'refund' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
Transaction |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Long |
getClientCreatedTime()
The time when the transaction was recorded on the client
|
Long |
getCreatedTime()
The time when the transaction was recorded on the server
|
Credit |
getCredit() |
CreditRefund |
getCreditRefund() |
protected GenericClient |
getGenericClient() |
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.
|
Payment |
getPayment() |
Refund |
getRefund() |
boolean |
hasClientCreatedTime()
Checks whether the 'clientCreatedTime' field has been set, however the value could be null
|
boolean |
hasCreatedTime()
Checks whether the 'createdTime' field has been set, however the value could be null
|
boolean |
hasCredit()
Checks whether the 'credit' field has been set, however the value could be null
|
boolean |
hasCreditRefund()
Checks whether the 'creditRefund' field has been set, however the value could be null
|
boolean |
hasPayment()
Checks whether the 'payment' field has been set, however the value could be null
|
boolean |
hasRefund()
Checks whether the 'refund' field has been set, however the value could be null
|
boolean |
isNotNullClientCreatedTime()
Checks whether the 'clientCreatedTime' field is set and is not null
|
boolean |
isNotNullCreatedTime()
Checks whether the 'createdTime' field is set and is not null
|
boolean |
isNotNullCredit()
Checks whether the 'credit' field is set and is not null
|
boolean |
isNotNullCreditRefund()
Checks whether the 'creditRefund' field is set and is not null
|
boolean |
isNotNullPayment()
Checks whether the 'payment' field is set and is not null
|
boolean |
isNotNullRefund()
Checks whether the 'refund' field is set and is not null
|
void |
mergeChanges(Transaction 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.
|
Transaction |
setClientCreatedTime(Long clientCreatedTime)
Sets the field 'clientCreatedTime'.
|
Transaction |
setCreatedTime(Long createdTime)
Sets the field 'createdTime'.
|
Transaction |
setCredit(Credit credit)
Sets the field 'credit'.
|
Transaction |
setCreditRefund(CreditRefund creditRefund)
Sets the field 'creditRefund'.
|
Transaction |
setPayment(Payment payment)
Sets the field 'payment'.
|
Transaction |
setRefund(Refund refund)
Sets the field 'refund'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<Transaction> CREATOR
public static final JSONifiable.Creator<Transaction> JSON_CREATOR
public Transaction()
protected Transaction(boolean noInit)
public Transaction(String json) throws IllegalArgumentException
IllegalArgumentException
public Transaction(JSONObject jsonObject)
public Transaction(Transaction src)
public Long getCreatedTime()
public Long getClientCreatedTime()
public Payment getPayment()
public Refund getRefund()
public Credit getCredit()
public CreditRefund getCreditRefund()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullCreatedTime()
public boolean isNotNullClientCreatedTime()
public boolean isNotNullPayment()
public boolean isNotNullRefund()
public boolean isNotNullCredit()
public boolean isNotNullCreditRefund()
public boolean hasCreatedTime()
public boolean hasClientCreatedTime()
public boolean hasPayment()
public boolean hasRefund()
public boolean hasCredit()
public boolean hasCreditRefund()
public Transaction setCreatedTime(Long createdTime)
public Transaction setClientCreatedTime(Long clientCreatedTime)
public Transaction setPayment(Payment payment)
public Transaction setRefund(Refund refund)
public Transaction setCredit(Credit credit)
public Transaction setCreditRefund(CreditRefund creditRefund)
public void clearCreatedTime()
public void clearClientCreatedTime()
public void clearPayment()
public void clearRefund()
public void clearCredit()
public void clearCreditRefund()
public boolean containsChanges()
public void resetChangeLog()
public Transaction copyChanges()
public void mergeChanges(Transaction src)