public class Customer extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
Customer.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<Customer> |
CREATOR |
static JSONifiable.Creator<Customer> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
Customer()
Constructs a new empty instance.
|
protected |
Customer(boolean noInit)
Constructs a new empty instance.
|
|
Customer(Customer src)
Constructs a new instance that is a deep copy of the source instance.
|
|
Customer(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.
|
|
Customer(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAddresses()
Clears the 'addresses' field, the 'has' method for this field will now return false
|
void |
clearCards()
Clears the 'cards' field, the 'has' method for this field will now return false
|
void |
clearCustomerSince()
Clears the 'customerSince' field, the 'has' method for this field will now return false
|
void |
clearEmailAddresses()
Clears the 'emailAddresses' 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 |
clearLastName()
Clears the 'lastName' field, the 'has' method for this field will now return false
|
void |
clearMarketingAllowed()
Clears the 'marketingAllowed' field, the 'has' method for this field will now return false
|
void |
clearMerchant()
Clears the 'merchant' field, the 'has' method for this field will now return false
|
void |
clearMetadata()
Clears the 'metadata' field, the 'has' method for this field will now return false
|
void |
clearOrders()
Clears the 'orders' field, the 'has' method for this field will now return false
|
void |
clearPhoneNumbers()
Clears the 'phoneNumbers' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
Customer |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
List<Address> |
getAddresses() |
List<Card> |
getCards() |
Long |
getCustomerSince() |
List<EmailAddress> |
getEmailAddresses() |
String |
getFirstName()
First/given name of the customer
|
protected GenericClient |
getGenericClient() |
String |
getId()
Unique identifier
|
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 |
getLastName()
Last name/surname of the customer
|
Boolean |
getMarketingAllowed() |
Reference |
getMerchant()
The merchant that is associated with this customer
|
CustomerMetadata |
getMetadata()
Additional information about the customer.
|
List<Reference> |
getOrders() |
List<PhoneNumber> |
getPhoneNumbers() |
boolean |
hasAddresses()
Checks whether the 'addresses' field has been set, however the value could be null
|
boolean |
hasCards()
Checks whether the 'cards' field has been set, however the value could be null
|
boolean |
hasCustomerSince()
Checks whether the 'customerSince' field has been set, however the value could be null
|
boolean |
hasEmailAddresses()
Checks whether the 'emailAddresses' 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 |
hasLastName()
Checks whether the 'lastName' field has been set, however the value could be null
|
boolean |
hasMarketingAllowed()
Checks whether the 'marketingAllowed' field has been set, however the value could be null
|
boolean |
hasMerchant()
Checks whether the 'merchant' field has been set, however the value could be null
|
boolean |
hasMetadata()
Checks whether the 'metadata' field has been set, however the value could be null
|
boolean |
hasOrders()
Checks whether the 'orders' field has been set, however the value could be null
|
boolean |
hasPhoneNumbers()
Checks whether the 'phoneNumbers' field has been set, however the value could be null
|
boolean |
isNotEmptyAddresses()
Checks whether the 'addresses' field is set and is not null and is not empty
|
boolean |
isNotEmptyCards()
Checks whether the 'cards' field is set and is not null and is not empty
|
boolean |
isNotEmptyEmailAddresses()
Checks whether the 'emailAddresses' field is set and is not null and is not empty
|
boolean |
isNotEmptyOrders()
Checks whether the 'orders' field is set and is not null and is not empty
|
boolean |
isNotEmptyPhoneNumbers()
Checks whether the 'phoneNumbers' field is set and is not null and is not empty
|
boolean |
isNotNullAddresses()
Checks whether the 'addresses' field is set and is not null
|
boolean |
isNotNullCards()
Checks whether the 'cards' field is set and is not null
|
boolean |
isNotNullCustomerSince()
Checks whether the 'customerSince' field is set and is not null
|
boolean |
isNotNullEmailAddresses()
Checks whether the 'emailAddresses' 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 |
isNotNullLastName()
Checks whether the 'lastName' field is set and is not null
|
boolean |
isNotNullMarketingAllowed()
Checks whether the 'marketingAllowed' field is set and is not null
|
boolean |
isNotNullMerchant()
Checks whether the 'merchant' field is set and is not null
|
boolean |
isNotNullMetadata()
Checks whether the 'metadata' field is set and is not null
|
boolean |
isNotNullOrders()
Checks whether the 'orders' field is set and is not null
|
boolean |
isNotNullPhoneNumbers()
Checks whether the 'phoneNumbers' field is set and is not null
|
void |
mergeChanges(Customer 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.
|
Customer |
setAddresses(List<Address> addresses)
Sets the field 'addresses'.
|
Customer |
setCards(List<Card> cards)
Sets the field 'cards'.
|
Customer |
setCustomerSince(Long customerSince)
Sets the field 'customerSince'.
|
Customer |
setEmailAddresses(List<EmailAddress> emailAddresses)
Sets the field 'emailAddresses'.
|
Customer |
setFirstName(String firstName)
Sets the field 'firstName'.
|
Customer |
setId(String id)
Sets the field 'id'.
|
Customer |
setLastName(String lastName)
Sets the field 'lastName'.
|
Customer |
setMarketingAllowed(Boolean marketingAllowed)
Sets the field 'marketingAllowed'.
|
Customer |
setMerchant(Reference merchant)
Sets the field 'merchant'.
|
Customer |
setMetadata(CustomerMetadata metadata)
Sets the field 'metadata'.
|
Customer |
setOrders(List<Reference> orders)
Sets the field 'orders'.
|
Customer |
setPhoneNumbers(List<PhoneNumber> phoneNumbers)
Sets the field 'phoneNumbers'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<Customer> CREATOR
public static final JSONifiable.Creator<Customer> JSON_CREATOR
public Customer()
protected Customer(boolean noInit)
public Customer(String json) throws IllegalArgumentException
IllegalArgumentException
public Customer(JSONObject jsonObject)
public Customer(Customer src)
public String getId()
public Reference getMerchant()
public String getFirstName()
public String getLastName()
public Boolean getMarketingAllowed()
public Long getCustomerSince()
public List<EmailAddress> getEmailAddresses()
public List<PhoneNumber> getPhoneNumbers()
public CustomerMetadata getMetadata()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullMerchant()
public boolean isNotNullFirstName()
public boolean isNotNullLastName()
public boolean isNotNullMarketingAllowed()
public boolean isNotNullCustomerSince()
public boolean isNotNullOrders()
public boolean isNotEmptyOrders()
public boolean isNotNullAddresses()
public boolean isNotEmptyAddresses()
public boolean isNotNullEmailAddresses()
public boolean isNotEmptyEmailAddresses()
public boolean isNotNullPhoneNumbers()
public boolean isNotEmptyPhoneNumbers()
public boolean isNotNullCards()
public boolean isNotEmptyCards()
public boolean isNotNullMetadata()
public boolean hasId()
public boolean hasMerchant()
public boolean hasFirstName()
public boolean hasLastName()
public boolean hasMarketingAllowed()
public boolean hasCustomerSince()
public boolean hasOrders()
public boolean hasAddresses()
public boolean hasEmailAddresses()
public boolean hasPhoneNumbers()
public boolean hasCards()
public boolean hasMetadata()
public Customer setMerchant(Reference merchant)
public Customer setMarketingAllowed(Boolean marketingAllowed)
public Customer setCustomerSince(Long customerSince)
public Customer setOrders(List<Reference> orders)
public Customer setAddresses(List<Address> addresses)
public Customer setEmailAddresses(List<EmailAddress> emailAddresses)
public Customer setPhoneNumbers(List<PhoneNumber> phoneNumbers)
public Customer setCards(List<Card> cards)
public Customer setMetadata(CustomerMetadata metadata)
public void clearId()
public void clearMerchant()
public void clearFirstName()
public void clearLastName()
public void clearMarketingAllowed()
public void clearCustomerSince()
public void clearOrders()
public void clearAddresses()
public void clearEmailAddresses()
public void clearPhoneNumbers()
public void clearCards()
public void clearMetadata()
public boolean containsChanges()
public void resetChangeLog()
public Customer copyChanges()
public void mergeChanges(Customer src)