Package com.clover.sdk.v3.customers
Class Card
- java.lang.Object
-
- com.clover.sdk.GenericParcelable
-
- com.clover.sdk.v3.customers.Card
-
- All Implemented Interfaces:
Parcelable
,JSONifiable
,Validator
public class Card extends GenericParcelable implements Validator, JSONifiable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Card.Constraints
-
Nested classes/interfaces inherited from interface com.clover.sdk.JSONifiable
JSONifiable.Creator<T>
-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Parcelable.Creator<Card>
CREATOR
static JSONifiable.Creator<Card>
JSON_CREATOR
-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor 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(String json)
Constructs a new instance from the given JSON String.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCardType()
Clears the 'cardType' field, the 'has' method for this field will now return falsevoid
clearCustomer()
Clears the 'customer' field, the 'has' method for this field will now return falsevoid
clearExpirationDate()
Clears the 'expirationDate' field, the 'has' method for this field will now return falsevoid
clearFirst6()
Clears the 'first6' field, the 'has' method for this field will now return falsevoid
clearFirstName()
Clears the 'firstName' field, the 'has' method for this field will now return falsevoid
clearId()
Clears the 'id' field, the 'has' method for this field will now return falsevoid
clearLast4()
Clears the 'last4' field, the 'has' method for this field will now return falsevoid
clearLastName()
Clears the 'lastName' field, the 'has' method for this field will now return falsevoid
clearModifiedTime()
Clears the 'modifiedTime' field, the 'has' method for this field will now return falsevoid
clearToken()
Clears the 'token' field, the 'has' method for this field will now return falsevoid
clearTokenType()
Clears the 'tokenType' field, the 'has' method for this field will now return falseboolean
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 nullboolean
hasCustomer()
Checks whether the 'customer' field has been set, however the value could be nullboolean
hasExpirationDate()
Checks whether the 'expirationDate' field has been set, however the value could be nullboolean
hasFirst6()
Checks whether the 'first6' field has been set, however the value could be nullboolean
hasFirstName()
Checks whether the 'firstName' field has been set, however the value could be nullboolean
hasId()
Checks whether the 'id' field has been set, however the value could be nullboolean
hasLast4()
Checks whether the 'last4' field has been set, however the value could be nullboolean
hasLastName()
Checks whether the 'lastName' field has been set, however the value could be nullboolean
hasModifiedTime()
Checks whether the 'modifiedTime' field has been set, however the value could be nullboolean
hasToken()
Checks whether the 'token' field has been set, however the value could be nullboolean
hasTokenType()
Checks whether the 'tokenType' field has been set, however the value could be nullboolean
isNotNullCardType()
Checks whether the 'cardType' field is set and is not nullboolean
isNotNullCustomer()
Checks whether the 'customer' field is set and is not nullboolean
isNotNullExpirationDate()
Checks whether the 'expirationDate' field is set and is not nullboolean
isNotNullFirst6()
Checks whether the 'first6' field is set and is not nullboolean
isNotNullFirstName()
Checks whether the 'firstName' field is set and is not nullboolean
isNotNullId()
Checks whether the 'id' field is set and is not nullboolean
isNotNullLast4()
Checks whether the 'last4' field is set and is not nullboolean
isNotNullLastName()
Checks whether the 'lastName' field is set and is not nullboolean
isNotNullModifiedTime()
Checks whether the 'modifiedTime' field is set and is not nullboolean
isNotNullToken()
Checks whether the 'token' field is set and is not nullboolean
isNotNullTokenType()
Checks whether the 'tokenType' field is set and is not nullvoid
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()
-
Methods inherited from class com.clover.sdk.GenericParcelable
describeContents, getBundle, toString, writeToParcel
-
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<Card> CREATOR
-
JSON_CREATOR
public static final JSONifiable.Creator<Card> JSON_CREATOR
-
-
Constructor Detail
-
Card
public Card()
Constructs a new empty instance.
-
Card
protected Card(boolean noInit)
Constructs a new empty instance.
-
Card
public Card(String json) throws IllegalArgumentException
Constructs a new instance from the given JSON String.- Throws:
IllegalArgumentException
-
Card
public 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
public Card(Card src)
Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
-
-
Method Detail
-
getId
public String getId()
-
getFirst6
public String getFirst6()
-
getLast4
public String getLast4()
-
getFirstName
public String getFirstName()
-
getLastName
public String getLastName()
-
getExpirationDate
public String getExpirationDate()
-
getCardType
public String getCardType()
-
getToken
public String getToken()
-
getTokenType
public TokenType getTokenType()
-
getModifiedTime
public Long getModifiedTime()
The timestamp from when this card was last updated.
-
getCustomer
public Reference getCustomer()
Customer who this card belongs to.
-
getGenericClient
protected GenericClient getGenericClient()
- Specified by:
getGenericClient
in classGenericParcelable
-
getJSONObject
public 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.- Specified by:
getJSONObject
in interfaceJSONifiable
-
isNotNullId
public boolean isNotNullId()
Checks whether the 'id' field is set and is not null
-
isNotNullFirst6
public boolean isNotNullFirst6()
Checks whether the 'first6' field is set and is not null
-
isNotNullLast4
public boolean isNotNullLast4()
Checks whether the 'last4' field is set and is not null
-
isNotNullFirstName
public boolean isNotNullFirstName()
Checks whether the 'firstName' field is set and is not null
-
isNotNullLastName
public boolean isNotNullLastName()
Checks whether the 'lastName' field is set and is not null
-
isNotNullExpirationDate
public boolean isNotNullExpirationDate()
Checks whether the 'expirationDate' field is set and is not null
-
isNotNullCardType
public boolean isNotNullCardType()
Checks whether the 'cardType' field is set and is not null
-
isNotNullToken
public boolean isNotNullToken()
Checks whether the 'token' field is set and is not null
-
isNotNullTokenType
public boolean isNotNullTokenType()
Checks whether the 'tokenType' field is set and is not null
-
isNotNullModifiedTime
public boolean isNotNullModifiedTime()
Checks whether the 'modifiedTime' field is set and is not null
-
isNotNullCustomer
public boolean isNotNullCustomer()
Checks whether the 'customer' field is set and is not null
-
hasId
public boolean hasId()
Checks whether the 'id' field has been set, however the value could be null
-
hasFirst6
public boolean hasFirst6()
Checks whether the 'first6' field has been set, however the value could be null
-
hasLast4
public boolean hasLast4()
Checks whether the 'last4' field has been set, however the value could be null
-
hasFirstName
public boolean hasFirstName()
Checks whether the 'firstName' field has been set, however the value could be null
-
hasLastName
public boolean hasLastName()
Checks whether the 'lastName' field has been set, however the value could be null
-
hasExpirationDate
public boolean hasExpirationDate()
Checks whether the 'expirationDate' field has been set, however the value could be null
-
hasCardType
public boolean hasCardType()
Checks whether the 'cardType' field has been set, however the value could be null
-
hasToken
public boolean hasToken()
Checks whether the 'token' field has been set, however the value could be null
-
hasTokenType
public boolean hasTokenType()
Checks whether the 'tokenType' field has been set, however the value could be null
-
hasModifiedTime
public boolean hasModifiedTime()
Checks whether the 'modifiedTime' field has been set, however the value could be null
-
hasCustomer
public boolean hasCustomer()
Checks whether the 'customer' field has been set, however the value could be null
-
setExpirationDate
public Card setExpirationDate(String expirationDate)
Sets the field 'expirationDate'.
-
setCustomer
public Card setCustomer(Reference customer)
Sets the field 'customer'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
-
clearId
public void clearId()
Clears the 'id' field, the 'has' method for this field will now return false
-
clearFirst6
public void clearFirst6()
Clears the 'first6' field, the 'has' method for this field will now return false
-
clearLast4
public void clearLast4()
Clears the 'last4' field, the 'has' method for this field will now return false
-
clearFirstName
public void clearFirstName()
Clears the 'firstName' field, the 'has' method for this field will now return false
-
clearLastName
public void clearLastName()
Clears the 'lastName' field, the 'has' method for this field will now return false
-
clearExpirationDate
public void clearExpirationDate()
Clears the 'expirationDate' field, the 'has' method for this field will now return false
-
clearCardType
public void clearCardType()
Clears the 'cardType' field, the 'has' method for this field will now return false
-
clearToken
public void clearToken()
Clears the 'token' field, the 'has' method for this field will now return false
-
clearTokenType
public void clearTokenType()
Clears the 'tokenType' field, the 'has' method for this field will now return false
-
clearModifiedTime
public void clearModifiedTime()
Clears the 'modifiedTime' field, the 'has' method for this field will now return false
-
clearCustomer
public void clearCustomer()
Clears the 'customer' field, the 'has' method for this field will now return false
-
containsChanges
public boolean containsChanges()
Returns true if this instance has any changes.
-
resetChangeLog
public void resetChangeLog()
Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
-
copyChanges
public Card copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
-
mergeChanges
public void mergeChanges(Card src)
Copy all the changed fields from the given source to this instance.
-
-