public class CreditRequest extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
CreditRequest.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<CreditRequest> |
CREATOR |
static JSONifiable.Creator<CreditRequest> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
CreditRequest()
Constructs a new empty instance.
|
protected |
CreditRequest(boolean noInit)
Constructs a new empty instance.
|
|
CreditRequest(CreditRequest src)
Constructs a new instance that is a deep copy of the source instance.
|
|
CreditRequest(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.
|
|
CreditRequest(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCredit()
Clears the 'credit' field, the 'has' method for this field will now return false
|
void |
clearOrderId()
Clears the 'orderId' field, the 'has' method for this field will now return false
|
void |
clearPaymentCard()
Clears the 'paymentCard' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
CreditRequest |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Credit |
getCredit() |
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.
|
String |
getOrderId()
Unique identifier of the order with which this payment is associated
|
PaymentRequestCardDetails |
getPaymentCard() |
boolean |
hasCredit()
Checks whether the 'credit' field has been set, however the value could be null
|
boolean |
hasOrderId()
Checks whether the 'orderId' field has been set, however the value could be null
|
boolean |
hasPaymentCard()
Checks whether the 'paymentCard' field has been set, however the value could be null
|
boolean |
isNotNullCredit()
Checks whether the 'credit' field is set and is not null
|
boolean |
isNotNullOrderId()
Checks whether the 'orderId' field is set and is not null
|
boolean |
isNotNullPaymentCard()
Checks whether the 'paymentCard' field is set and is not null
|
void |
mergeChanges(CreditRequest 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.
|
CreditRequest |
setCredit(Credit credit)
Sets the field 'credit'.
|
CreditRequest |
setOrderId(String orderId)
Sets the field 'orderId'.
|
CreditRequest |
setPaymentCard(PaymentRequestCardDetails paymentCard)
Sets the field 'paymentCard'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<CreditRequest> CREATOR
public static final JSONifiable.Creator<CreditRequest> JSON_CREATOR
public CreditRequest()
protected CreditRequest(boolean noInit)
public CreditRequest(String json) throws IllegalArgumentException
IllegalArgumentException
public CreditRequest(JSONObject jsonObject)
public CreditRequest(CreditRequest src)
public String getOrderId()
public Credit getCredit()
public PaymentRequestCardDetails getPaymentCard()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullOrderId()
public boolean isNotNullCredit()
public boolean isNotNullPaymentCard()
public boolean hasOrderId()
public boolean hasCredit()
public boolean hasPaymentCard()
public CreditRequest setOrderId(String orderId)
public CreditRequest setCredit(Credit credit)
public CreditRequest setPaymentCard(PaymentRequestCardDetails paymentCard)
public void clearOrderId()
public void clearCredit()
public void clearPaymentCard()
public boolean containsChanges()
public void resetChangeLog()
public CreditRequest copyChanges()
public void mergeChanges(CreditRequest src)