Package com.clover.sdk.v3.customers
Class CustomerInfo
- java.lang.Object
-
- com.clover.sdk.GenericParcelable
-
- com.clover.sdk.v3.customers.CustomerInfo
-
- All Implemented Interfaces:
Parcelable
,JSONifiable
,Validator
public class CustomerInfo extends GenericParcelable implements Validator, JSONifiable
This is an auto-generated Clover data object.Represents a customer that is linked to an external system. This customer may be persisted in Clover, or it may not.
Fields
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CustomerInfo.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<CustomerInfo>
CREATOR
static JSONifiable.Creator<CustomerInfo>
JSON_CREATOR
-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor Description CustomerInfo()
Constructs a new empty instance.protected
CustomerInfo(boolean noInit)
Constructs a new empty instance.CustomerInfo(CustomerInfo src)
Constructs a new instance that is a deep copy of the source instance.CustomerInfo(String json)
Constructs a new instance from the given JSON String.CustomerInfo(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
clearCustomer()
Clears the 'customer' field, the 'has' method for this field will now return falsevoid
clearDisplayString()
Clears the 'displayString' field, the 'has' method for this field will now return falsevoid
clearExternalId()
Clears the 'externalId' field, the 'has' method for this field will now return falsevoid
clearExternalSystemName()
Clears the 'externalSystemName' field, the 'has' method for this field will now return falsevoid
clearExtras()
Clears the 'extras' field, the 'has' method for this field will now return falseboolean
containsChanges()
Returns true if this instance has any changes.CustomerInfo
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.Customer
getCustomer()
The customer object that Clover uses.String
getDisplayString()
A custom way to display this customer for an external systemString
getExternalId()
an id for an external system to use to reference this Customer.String
getExternalSystemName()
The name of the external system that 'owns' this.Map<String,String>
getExtras()
Extra data used by external systems.protected GenericClient
getGenericClient()
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.boolean
hasCustomer()
Checks whether the 'customer' field has been set, however the value could be nullboolean
hasDisplayString()
Checks whether the 'displayString' field has been set, however the value could be nullboolean
hasExternalId()
Checks whether the 'externalId' field has been set, however the value could be nullboolean
hasExternalSystemName()
Checks whether the 'externalSystemName' field has been set, however the value could be nullboolean
hasExtras()
Checks whether the 'extras' field has been set, however the value could be nullboolean
isNotEmptyExtras()
Checks whether the 'extras' field is set and is not null and is not emptyboolean
isNotNullCustomer()
Checks whether the 'customer' field is set and is not nullboolean
isNotNullDisplayString()
Checks whether the 'displayString' field is set and is not nullboolean
isNotNullExternalId()
Checks whether the 'externalId' field is set and is not nullboolean
isNotNullExternalSystemName()
Checks whether the 'externalSystemName' field is set and is not nullboolean
isNotNullExtras()
Checks whether the 'extras' field is set and is not nullvoid
mergeChanges(CustomerInfo 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.CustomerInfo
setCustomer(Customer customer)
Sets the field 'customer'.CustomerInfo
setDisplayString(String displayString)
Sets the field 'displayString'.CustomerInfo
setExternalId(String externalId)
Sets the field 'externalId'.CustomerInfo
setExternalSystemName(String externalSystemName)
Sets the field 'externalSystemName'.CustomerInfo
setExtras(Map<String,String> extras)
Sets the field 'extras'.void
validate()
-
Methods inherited from class com.clover.sdk.GenericParcelable
describeContents, getBundle, toString, writeToParcel
-
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<CustomerInfo> CREATOR
-
JSON_CREATOR
public static final JSONifiable.Creator<CustomerInfo> JSON_CREATOR
-
-
Constructor Detail
-
CustomerInfo
public CustomerInfo()
Constructs a new empty instance.
-
CustomerInfo
protected CustomerInfo(boolean noInit)
Constructs a new empty instance.
-
CustomerInfo
public CustomerInfo(String json) throws IllegalArgumentException
Constructs a new instance from the given JSON String.- Throws:
IllegalArgumentException
-
CustomerInfo
public CustomerInfo(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.
-
CustomerInfo
public CustomerInfo(CustomerInfo src)
Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
-
-
Method Detail
-
getCustomer
public Customer getCustomer()
The customer object that Clover uses. This is the base model for a Clover customer, any additional information external systems need should exist in other fields
-
getDisplayString
public String getDisplayString()
A custom way to display this customer for an external system
-
getExternalId
public String getExternalId()
an id for an external system to use to reference this Customer.
-
getExternalSystemName
public String getExternalSystemName()
The name of the external system that 'owns' this. It is the system that understands the link from the externalId to 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
-
isNotNullCustomer
public boolean isNotNullCustomer()
Checks whether the 'customer' field is set and is not null
-
isNotNullDisplayString
public boolean isNotNullDisplayString()
Checks whether the 'displayString' field is set and is not null
-
isNotNullExternalId
public boolean isNotNullExternalId()
Checks whether the 'externalId' field is set and is not null
-
isNotNullExternalSystemName
public boolean isNotNullExternalSystemName()
Checks whether the 'externalSystemName' field is set and is not null
-
isNotNullExtras
public boolean isNotNullExtras()
Checks whether the 'extras' field is set and is not null
-
isNotEmptyExtras
public boolean isNotEmptyExtras()
Checks whether the 'extras' field is set and is not null and is not empty
-
hasCustomer
public boolean hasCustomer()
Checks whether the 'customer' field has been set, however the value could be null
-
hasDisplayString
public boolean hasDisplayString()
Checks whether the 'displayString' field has been set, however the value could be null
-
hasExternalId
public boolean hasExternalId()
Checks whether the 'externalId' field has been set, however the value could be null
-
hasExternalSystemName
public boolean hasExternalSystemName()
Checks whether the 'externalSystemName' field has been set, however the value could be null
-
hasExtras
public boolean hasExtras()
Checks whether the 'extras' field has been set, however the value could be null
-
setCustomer
public CustomerInfo setCustomer(Customer customer)
Sets the field 'customer'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
-
setDisplayString
public CustomerInfo setDisplayString(String displayString)
Sets the field 'displayString'.
-
setExternalId
public CustomerInfo setExternalId(String externalId)
Sets the field 'externalId'.
-
setExternalSystemName
public CustomerInfo setExternalSystemName(String externalSystemName)
Sets the field 'externalSystemName'.
-
setExtras
public CustomerInfo setExtras(Map<String,String> extras)
Sets the field 'extras'.
-
clearCustomer
public void clearCustomer()
Clears the 'customer' field, the 'has' method for this field will now return false
-
clearDisplayString
public void clearDisplayString()
Clears the 'displayString' field, the 'has' method for this field will now return false
-
clearExternalId
public void clearExternalId()
Clears the 'externalId' field, the 'has' method for this field will now return false
-
clearExternalSystemName
public void clearExternalSystemName()
Clears the 'externalSystemName' field, the 'has' method for this field will now return false
-
clearExtras
public void clearExtras()
Clears the 'extras' 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 CustomerInfo copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
-
mergeChanges
public void mergeChanges(CustomerInfo src)
Copy all the changed fields from the given source to this instance.
-
-