public class RemoteCustomer extends GenericParcelable implements Validator, JSONifiable
Deprecated, use CustomerInfo instead. 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 |
RemoteCustomer.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<RemoteCustomer> |
CREATOR |
static JSONifiable.Creator<RemoteCustomer> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
RemoteCustomer()
Constructs a new empty instance.
|
protected |
RemoteCustomer(boolean noInit)
Constructs a new empty instance.
|
|
RemoteCustomer(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.
|
|
RemoteCustomer(RemoteCustomer src)
Constructs a new instance that is a deep copy of the source instance.
|
|
RemoteCustomer(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.
|
RemoteCustomer |
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(RemoteCustomer 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.
|
RemoteCustomer |
setCustomer(Customer customer)
Sets the field 'customer'.
|
RemoteCustomer |
setDisplayString(String displayString)
Sets the field 'displayString'.
|
RemoteCustomer |
setExternalId(String externalId)
Sets the field 'externalId'.
|
RemoteCustomer |
setExternalSystemName(String externalSystemName)
Sets the field 'externalSystemName'.
|
RemoteCustomer |
setExtras(Map<String,String> extras)
Sets the field 'extras'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<RemoteCustomer> CREATOR
public static final JSONifiable.Creator<RemoteCustomer> JSON_CREATOR
public RemoteCustomer()
protected RemoteCustomer(boolean noInit)
public RemoteCustomer(String json) throws IllegalArgumentException
IllegalArgumentException
public RemoteCustomer(JSONObject jsonObject)
public RemoteCustomer(RemoteCustomer 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 RemoteCustomer setCustomer(Customer customer)
public RemoteCustomer setDisplayString(String displayString)
public RemoteCustomer setExternalId(String externalId)
public RemoteCustomer setExternalSystemName(String externalSystemName)
public RemoteCustomer 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 RemoteCustomer copyChanges()
public void mergeChanges(RemoteCustomer src)