Class Customer

    • Constructor Detail

      • Customer

        public Customer()
        Constructs a new empty instance.
      • Customer

        protected Customer​(boolean noInit)
        Constructs a new empty instance.
      • 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()
      • getCards

        public List<Card> getCards()
      • getMetadata

        public CustomerMetadata getMetadata()
        Additional information about the customer.
      • 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 interface JSONifiable
      • 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.
      • setFirstName

        public Customer setFirstName​(String firstName)
        Sets the field 'firstName'.
      • setLastName

        public Customer setLastName​(String lastName)
        Sets the field 'lastName'.
      • 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.