public class CustomerInfo extends GenericParcelable implements Validator, JSONifiable
Represents a customer that is linked to an external system. This customer may be persisted in Clover, or it may not.
Modifier and Type | Class and Description |
---|---|
static interface |
CustomerInfo.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<CustomerInfo> |
CREATOR |
static JSONifiable.Creator<CustomerInfo> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and 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(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(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCustomer()
Clears the 'customer' field, the 'has' method for this field will now return false
|
void |
clearDisplayString()
Clears the 'displayString' field, the 'has' method for this field will now return false
|
void |
clearExternalId()
Clears the 'externalId' field, the 'has' method for this field will now return false
|
void |
clearExternalSystemName()
Clears the 'externalSystemName' field, the 'has' method for this field will now return false
|
void |
clearExtras()
Clears the 'extras' field, the 'has' method for this field will now return false
|
boolean |
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 system
|
String |
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 null
|
boolean |
hasDisplayString()
Checks whether the 'displayString' field has been set, however the value could be null
|
boolean |
hasExternalId()
Checks whether the 'externalId' field has been set, however the value could be null
|
boolean |
hasExternalSystemName()
Checks whether the 'externalSystemName' field has been set, however the value could be null
|
boolean |
hasExtras()
Checks whether the 'extras' field has been set, however the value could be null
|
boolean |
isNotEmptyExtras()
Checks whether the 'extras' field is set and is not null and is not empty
|
boolean |
isNotNullCustomer()
Checks whether the 'customer' field is set and is not null
|
boolean |
isNotNullDisplayString()
Checks whether the 'displayString' field is set and is not null
|
boolean |
isNotNullExternalId()
Checks whether the 'externalId' field is set and is not null
|
boolean |
isNotNullExternalSystemName()
Checks whether the 'externalSystemName' field is set and is not null
|
boolean |
isNotNullExtras()
Checks whether the 'extras' field is set and is not null
|
void |
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() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<CustomerInfo> CREATOR
public static final JSONifiable.Creator<CustomerInfo> JSON_CREATOR
public CustomerInfo()
protected CustomerInfo(boolean noInit)
public CustomerInfo(String json) throws IllegalArgumentException
IllegalArgumentException
public CustomerInfo(JSONObject jsonObject)
public CustomerInfo(CustomerInfo src)
public Customer getCustomer()
public String getDisplayString()
public String getExternalId()
public String getExternalSystemName()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullCustomer()
public boolean isNotNullDisplayString()
public boolean isNotNullExternalId()
public boolean isNotNullExternalSystemName()
public boolean isNotNullExtras()
public boolean isNotEmptyExtras()
public boolean hasCustomer()
public boolean hasDisplayString()
public boolean hasExternalId()
public boolean hasExternalSystemName()
public boolean hasExtras()
public CustomerInfo setCustomer(Customer customer)
public CustomerInfo setDisplayString(String displayString)
public CustomerInfo setExternalId(String externalId)
public CustomerInfo setExternalSystemName(String externalSystemName)
public CustomerInfo setExtras(Map<String,String> extras)
public void clearCustomer()
public void clearDisplayString()
public void clearExternalId()
public void clearExternalSystemName()
public void clearExtras()
public boolean containsChanges()
public void resetChangeLog()
public CustomerInfo copyChanges()
public void mergeChanges(CustomerInfo src)