Package com.clover.sdk.v3.customers
Class Customer
- java.lang.Object
-
- com.clover.sdk.GenericParcelable
-
- com.clover.sdk.v3.customers.Customer
-
- All Implemented Interfaces:
Parcelable
,JSONifiable
,Validator
public class Customer extends GenericParcelable implements Validator, JSONifiable
This is an auto-generated Clover data object.Fields
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Customer.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<Customer>
CREATOR
static JSONifiable.Creator<Customer>
JSON_CREATOR
-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor 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(String json)
Constructs a new instance from the given JSON String.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAddresses()
Clears the 'addresses' field, the 'has' method for this field will now return falsevoid
clearCards()
Clears the 'cards' field, the 'has' method for this field will now return falsevoid
clearCustomerSince()
Clears the 'customerSince' field, the 'has' method for this field will now return falsevoid
clearEmailAddresses()
Clears the 'emailAddresses' 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
clearLastName()
Clears the 'lastName' field, the 'has' method for this field will now return falsevoid
clearMarketingAllowed()
Clears the 'marketingAllowed' field, the 'has' method for this field will now return falsevoid
clearMerchant()
Clears the 'merchant' field, the 'has' method for this field will now return falsevoid
clearMetadata()
Clears the 'metadata' field, the 'has' method for this field will now return falsevoid
clearOrders()
Clears the 'orders' field, the 'has' method for this field will now return falsevoid
clearPhoneNumbers()
Clears the 'phoneNumbers' field, the 'has' method for this field will now return falseboolean
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 customerprotected GenericClient
getGenericClient()
String
getId()
Unique identifierJSONObject
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 customerBoolean
getMarketingAllowed()
Reference
getMerchant()
The merchant that is associated with this customerCustomerMetadata
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 nullboolean
hasCards()
Checks whether the 'cards' field has been set, however the value could be nullboolean
hasCustomerSince()
Checks whether the 'customerSince' field has been set, however the value could be nullboolean
hasEmailAddresses()
Checks whether the 'emailAddresses' 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
hasLastName()
Checks whether the 'lastName' field has been set, however the value could be nullboolean
hasMarketingAllowed()
Checks whether the 'marketingAllowed' field has been set, however the value could be nullboolean
hasMerchant()
Checks whether the 'merchant' field has been set, however the value could be nullboolean
hasMetadata()
Checks whether the 'metadata' field has been set, however the value could be nullboolean
hasOrders()
Checks whether the 'orders' field has been set, however the value could be nullboolean
hasPhoneNumbers()
Checks whether the 'phoneNumbers' field has been set, however the value could be nullboolean
isNotEmptyAddresses()
Checks whether the 'addresses' field is set and is not null and is not emptyboolean
isNotEmptyCards()
Checks whether the 'cards' field is set and is not null and is not emptyboolean
isNotEmptyEmailAddresses()
Checks whether the 'emailAddresses' field is set and is not null and is not emptyboolean
isNotEmptyOrders()
Checks whether the 'orders' field is set and is not null and is not emptyboolean
isNotEmptyPhoneNumbers()
Checks whether the 'phoneNumbers' field is set and is not null and is not emptyboolean
isNotNullAddresses()
Checks whether the 'addresses' field is set and is not nullboolean
isNotNullCards()
Checks whether the 'cards' field is set and is not nullboolean
isNotNullCustomerSince()
Checks whether the 'customerSince' field is set and is not nullboolean
isNotNullEmailAddresses()
Checks whether the 'emailAddresses' 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
isNotNullLastName()
Checks whether the 'lastName' field is set and is not nullboolean
isNotNullMarketingAllowed()
Checks whether the 'marketingAllowed' field is set and is not nullboolean
isNotNullMerchant()
Checks whether the 'merchant' field is set and is not nullboolean
isNotNullMetadata()
Checks whether the 'metadata' field is set and is not nullboolean
isNotNullOrders()
Checks whether the 'orders' field is set and is not nullboolean
isNotNullPhoneNumbers()
Checks whether the 'phoneNumbers' field is set and is not nullvoid
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()
-
Methods inherited from class com.clover.sdk.GenericParcelable
describeContents, getBundle, toString, writeToParcel
-
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<Customer> CREATOR
-
JSON_CREATOR
public static final JSONifiable.Creator<Customer> JSON_CREATOR
-
-
Constructor Detail
-
Customer
public Customer()
Constructs a new empty instance.
-
Customer
protected Customer(boolean noInit)
Constructs a new empty instance.
-
Customer
public Customer(String json) throws IllegalArgumentException
Constructs a new instance from the given JSON String.- Throws:
IllegalArgumentException
-
Customer
public 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
public Customer(Customer 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()
Unique identifier
-
getMerchant
public Reference getMerchant()
The merchant that is associated with this customer
-
getFirstName
public String getFirstName()
First/given name of the customer
-
getLastName
public String getLastName()
Last name/surname of the customer
-
getMarketingAllowed
public Boolean getMarketingAllowed()
-
getCustomerSince
public Long getCustomerSince()
-
getEmailAddresses
public List<EmailAddress> getEmailAddresses()
-
getPhoneNumbers
public List<PhoneNumber> getPhoneNumbers()
-
getMetadata
public CustomerMetadata getMetadata()
Additional information about the customer.
-
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
-
isNotNullMerchant
public boolean isNotNullMerchant()
Checks whether the 'merchant' 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
-
isNotNullMarketingAllowed
public boolean isNotNullMarketingAllowed()
Checks whether the 'marketingAllowed' field is set and is not null
-
isNotNullCustomerSince
public boolean isNotNullCustomerSince()
Checks whether the 'customerSince' field is set and is not null
-
isNotNullOrders
public boolean isNotNullOrders()
Checks whether the 'orders' field is set and is not null
-
isNotEmptyOrders
public boolean isNotEmptyOrders()
Checks whether the 'orders' field is set and is not null and is not empty
-
isNotNullAddresses
public boolean isNotNullAddresses()
Checks whether the 'addresses' field is set and is not null
-
isNotEmptyAddresses
public boolean isNotEmptyAddresses()
Checks whether the 'addresses' field is set and is not null and is not empty
-
isNotNullEmailAddresses
public boolean isNotNullEmailAddresses()
Checks whether the 'emailAddresses' field is set and is not null
-
isNotEmptyEmailAddresses
public boolean isNotEmptyEmailAddresses()
Checks whether the 'emailAddresses' field is set and is not null and is not empty
-
isNotNullPhoneNumbers
public boolean isNotNullPhoneNumbers()
Checks whether the 'phoneNumbers' field is set and is not null
-
isNotEmptyPhoneNumbers
public boolean isNotEmptyPhoneNumbers()
Checks whether the 'phoneNumbers' field is set and is not null and is not empty
-
isNotNullCards
public boolean isNotNullCards()
Checks whether the 'cards' field is set and is not null
-
isNotEmptyCards
public boolean isNotEmptyCards()
Checks whether the 'cards' field is set and is not null and is not empty
-
isNotNullMetadata
public boolean isNotNullMetadata()
Checks whether the 'metadata' 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
-
hasMerchant
public boolean hasMerchant()
Checks whether the 'merchant' 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
-
hasMarketingAllowed
public boolean hasMarketingAllowed()
Checks whether the 'marketingAllowed' field has been set, however the value could be null
-
hasCustomerSince
public boolean hasCustomerSince()
Checks whether the 'customerSince' field has been set, however the value could be null
-
hasOrders
public boolean hasOrders()
Checks whether the 'orders' field has been set, however the value could be null
-
hasAddresses
public boolean hasAddresses()
Checks whether the 'addresses' field has been set, however the value could be null
-
hasEmailAddresses
public boolean hasEmailAddresses()
Checks whether the 'emailAddresses' field has been set, however the value could be null
-
hasPhoneNumbers
public boolean hasPhoneNumbers()
Checks whether the 'phoneNumbers' field has been set, however the value could be null
-
hasCards
public boolean hasCards()
Checks whether the 'cards' field has been set, however the value could be null
-
hasMetadata
public boolean hasMetadata()
Checks whether the 'metadata' field has been set, however the value could be null
-
setMerchant
public Customer setMerchant(Reference merchant)
Sets the field 'merchant'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
-
setMarketingAllowed
public Customer setMarketingAllowed(Boolean marketingAllowed)
Sets the field 'marketingAllowed'.
-
setCustomerSince
public Customer setCustomerSince(Long customerSince)
Sets the field 'customerSince'.
-
setOrders
public Customer setOrders(List<Reference> orders)
Sets the field 'orders'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
-
setAddresses
public Customer setAddresses(List<Address> addresses)
Sets the field 'addresses'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
-
setEmailAddresses
public Customer setEmailAddresses(List<EmailAddress> emailAddresses)
Sets the field 'emailAddresses'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
-
setPhoneNumbers
public Customer setPhoneNumbers(List<PhoneNumber> phoneNumbers)
Sets the field 'phoneNumbers'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
-
setCards
public Customer setCards(List<Card> cards)
Sets the field 'cards'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
-
setMetadata
public Customer setMetadata(CustomerMetadata metadata)
Sets the field 'metadata'. 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
-
clearMerchant
public void clearMerchant()
Clears the 'merchant' 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
-
clearMarketingAllowed
public void clearMarketingAllowed()
Clears the 'marketingAllowed' field, the 'has' method for this field will now return false
-
clearCustomerSince
public void clearCustomerSince()
Clears the 'customerSince' field, the 'has' method for this field will now return false
-
clearOrders
public void clearOrders()
Clears the 'orders' field, the 'has' method for this field will now return false
-
clearAddresses
public void clearAddresses()
Clears the 'addresses' field, the 'has' method for this field will now return false
-
clearEmailAddresses
public void clearEmailAddresses()
Clears the 'emailAddresses' field, the 'has' method for this field will now return false
-
clearPhoneNumbers
public void clearPhoneNumbers()
Clears the 'phoneNumbers' field, the 'has' method for this field will now return false
-
clearCards
public void clearCards()
Clears the 'cards' field, the 'has' method for this field will now return false
-
clearMetadata
public void clearMetadata()
Clears the 'metadata' 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 Customer copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
-
mergeChanges
public void mergeChanges(Customer src)
Copy all the changed fields from the given source to this instance.
-
-