public class CardlessPaymentData extends GenericParcelable implements Validator, JSONifiable
Data for a payment that is processed using a QR code or barcode.
Modifier and Type | Class and Description |
---|---|
static interface |
CardlessPaymentData.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<CardlessPaymentData> |
CREATOR |
static JSONifiable.Creator<CardlessPaymentData> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
CardlessPaymentData()
Constructs a new empty instance.
|
protected |
CardlessPaymentData(boolean noInit)
Constructs a new empty instance.
|
|
CardlessPaymentData(CardlessPaymentData src)
Constructs a new instance that is a deep copy of the source instance.
|
|
CardlessPaymentData(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.
|
|
CardlessPaymentData(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearPaymentData()
Clears the 'paymentData' field, the 'has' method for this field will now return false
|
void |
clearPaymentNetwork()
Clears the 'paymentNetwork' field, the 'has' method for this field will now return false
|
void |
clearPaymentType()
Clears the 'paymentType' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
CardlessPaymentData |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
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 |
getPaymentData()
QR code or barcode data
|
CardlessPaymentNetwork |
getPaymentNetwork()
Payment network
|
CardlessPaymentDataType |
getPaymentType()
Payment method
|
boolean |
hasPaymentData()
Checks whether the 'paymentData' field has been set, however the value could be null
|
boolean |
hasPaymentNetwork()
Checks whether the 'paymentNetwork' field has been set, however the value could be null
|
boolean |
hasPaymentType()
Checks whether the 'paymentType' field has been set, however the value could be null
|
boolean |
isNotNullPaymentData()
Checks whether the 'paymentData' field is set and is not null
|
boolean |
isNotNullPaymentNetwork()
Checks whether the 'paymentNetwork' field is set and is not null
|
boolean |
isNotNullPaymentType()
Checks whether the 'paymentType' field is set and is not null
|
void |
mergeChanges(CardlessPaymentData 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.
|
CardlessPaymentData |
setPaymentData(String paymentData)
Sets the field 'paymentData'.
|
CardlessPaymentData |
setPaymentNetwork(CardlessPaymentNetwork paymentNetwork)
Sets the field 'paymentNetwork'.
|
CardlessPaymentData |
setPaymentType(CardlessPaymentDataType paymentType)
Sets the field 'paymentType'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<CardlessPaymentData> CREATOR
public static final JSONifiable.Creator<CardlessPaymentData> JSON_CREATOR
public CardlessPaymentData()
protected CardlessPaymentData(boolean noInit)
public CardlessPaymentData(String json) throws IllegalArgumentException
IllegalArgumentException
public CardlessPaymentData(JSONObject jsonObject)
public CardlessPaymentData(CardlessPaymentData src)
public CardlessPaymentNetwork getPaymentNetwork()
public CardlessPaymentDataType getPaymentType()
public String getPaymentData()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullPaymentNetwork()
public boolean isNotNullPaymentType()
public boolean isNotNullPaymentData()
public boolean hasPaymentNetwork()
public boolean hasPaymentType()
public boolean hasPaymentData()
public CardlessPaymentData setPaymentNetwork(CardlessPaymentNetwork paymentNetwork)
public CardlessPaymentData setPaymentType(CardlessPaymentDataType paymentType)
public CardlessPaymentData setPaymentData(String paymentData)
public void clearPaymentNetwork()
public void clearPaymentType()
public void clearPaymentData()
public boolean containsChanges()
public void resetChangeLog()
public CardlessPaymentData copyChanges()
public void mergeChanges(CardlessPaymentData src)