public class Card extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
Card.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<Card> |
CREATOR |
static JSONifiable.Creator<Card> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
Card()
Constructs a new empty instance.
|
protected |
Card(boolean noInit)
Constructs a new empty instance.
|
|
Card(Card src)
Constructs a new instance that is a deep copy of the source instance.
|
|
Card(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.
|
|
Card(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCardType()
Clears the 'cardType' field, the 'has' method for this field will now return false
|
void |
clearCustomer()
Clears the 'customer' field, the 'has' method for this field will now return false
|
void |
clearExpirationDate()
Clears the 'expirationDate' field, the 'has' method for this field will now return false
|
void |
clearFirst6()
Clears the 'first6' field, the 'has' method for this field will now return false
|
void |
clearFirstName()
Clears the 'firstName' 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 |
clearLast4()
Clears the 'last4' field, the 'has' method for this field will now return false
|
void |
clearLastName()
Clears the 'lastName' 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 |
clearToken()
Clears the 'token' field, the 'has' method for this field will now return false
|
void |
clearTokenType()
Clears the 'tokenType' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
Card |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
String |
getCardType() |
Reference |
getCustomer()
Customer who this card belongs to.
|
String |
getExpirationDate() |
String |
getFirst6() |
String |
getFirstName() |
protected GenericClient |
getGenericClient() |
String |
getId() |
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 |
getLast4() |
String |
getLastName() |
Long |
getModifiedTime()
The timestamp from when this card was last updated.
|
String |
getToken() |
TokenType |
getTokenType() |
boolean |
hasCardType()
Checks whether the 'cardType' field has been set, however the value could be null
|
boolean |
hasCustomer()
Checks whether the 'customer' field has been set, however the value could be null
|
boolean |
hasExpirationDate()
Checks whether the 'expirationDate' field has been set, however the value could be null
|
boolean |
hasFirst6()
Checks whether the 'first6' field has been set, however the value could be null
|
boolean |
hasFirstName()
Checks whether the 'firstName' 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 |
hasLast4()
Checks whether the 'last4' field has been set, however the value could be null
|
boolean |
hasLastName()
Checks whether the 'lastName' 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 |
hasToken()
Checks whether the 'token' field has been set, however the value could be null
|
boolean |
hasTokenType()
Checks whether the 'tokenType' field has been set, however the value could be null
|
boolean |
isNotNullCardType()
Checks whether the 'cardType' field is set and is not null
|
boolean |
isNotNullCustomer()
Checks whether the 'customer' field is set and is not null
|
boolean |
isNotNullExpirationDate()
Checks whether the 'expirationDate' field is set and is not null
|
boolean |
isNotNullFirst6()
Checks whether the 'first6' field is set and is not null
|
boolean |
isNotNullFirstName()
Checks whether the 'firstName' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullLast4()
Checks whether the 'last4' field is set and is not null
|
boolean |
isNotNullLastName()
Checks whether the 'lastName' field is set and is not null
|
boolean |
isNotNullModifiedTime()
Checks whether the 'modifiedTime' field is set and is not null
|
boolean |
isNotNullToken()
Checks whether the 'token' field is set and is not null
|
boolean |
isNotNullTokenType()
Checks whether the 'tokenType' field is set and is not null
|
void |
mergeChanges(Card 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.
|
Card |
setCardType(String cardType)
Sets the field 'cardType'.
|
Card |
setCustomer(Reference customer)
Sets the field 'customer'.
|
Card |
setExpirationDate(String expirationDate)
Sets the field 'expirationDate'.
|
Card |
setFirst6(String first6)
Sets the field 'first6'.
|
Card |
setFirstName(String firstName)
Sets the field 'firstName'.
|
Card |
setId(String id)
Sets the field 'id'.
|
Card |
setLast4(String last4)
Sets the field 'last4'.
|
Card |
setLastName(String lastName)
Sets the field 'lastName'.
|
Card |
setModifiedTime(Long modifiedTime)
Sets the field 'modifiedTime'.
|
Card |
setToken(String token)
Sets the field 'token'.
|
Card |
setTokenType(TokenType tokenType)
Sets the field 'tokenType'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<Card> CREATOR
public static final JSONifiable.Creator<Card> JSON_CREATOR
public Card()
protected Card(boolean noInit)
public Card(String json) throws IllegalArgumentException
IllegalArgumentException
public Card(JSONObject jsonObject)
public Card(Card src)
public String getId()
public String getFirst6()
public String getLast4()
public String getFirstName()
public String getLastName()
public String getExpirationDate()
public String getCardType()
public String getToken()
public TokenType getTokenType()
public Long getModifiedTime()
public Reference getCustomer()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullFirst6()
public boolean isNotNullLast4()
public boolean isNotNullFirstName()
public boolean isNotNullLastName()
public boolean isNotNullExpirationDate()
public boolean isNotNullCardType()
public boolean isNotNullToken()
public boolean isNotNullTokenType()
public boolean isNotNullModifiedTime()
public boolean isNotNullCustomer()
public boolean hasId()
public boolean hasFirst6()
public boolean hasLast4()
public boolean hasFirstName()
public boolean hasLastName()
public boolean hasExpirationDate()
public boolean hasCardType()
public boolean hasToken()
public boolean hasTokenType()
public boolean hasModifiedTime()
public boolean hasCustomer()
public Card setExpirationDate(String expirationDate)
public Card setCustomer(Reference customer)
public void clearId()
public void clearFirst6()
public void clearLast4()
public void clearFirstName()
public void clearLastName()
public void clearExpirationDate()
public void clearCardType()
public void clearToken()
public void clearTokenType()
public void clearModifiedTime()
public void clearCustomer()
public boolean containsChanges()
public void resetChangeLog()
public Card copyChanges()
public void mergeChanges(Card src)