public class PhoneNumber extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
PhoneNumber.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<PhoneNumber> |
CREATOR |
static JSONifiable.Creator<PhoneNumber> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
PhoneNumber()
Constructs a new empty instance.
|
protected |
PhoneNumber(boolean noInit)
Constructs a new empty instance.
|
|
PhoneNumber(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.
|
|
PhoneNumber(PhoneNumber src)
Constructs a new instance that is a deep copy of the source instance.
|
|
PhoneNumber(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 |
clearId()
Clears the 'id' field, the 'has' method for this field will now return false
|
void |
clearPhoneNumber()
Clears the 'phoneNumber' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
PhoneNumber |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Reference |
getCustomer()
Customer who this phone number belongs to.
|
protected GenericClient |
getGenericClient() |
String |
getId() |
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.
|
String |
getPhoneNumber() |
boolean |
hasCustomer()
Checks whether the 'customer' field has been set, however the value could be null
|
boolean |
hasId()
Checks whether the 'id' field has been set, however the value could be null
|
boolean |
hasPhoneNumber()
Checks whether the 'phoneNumber' field has been set, however the value could be null
|
boolean |
isNotNullCustomer()
Checks whether the 'customer' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullPhoneNumber()
Checks whether the 'phoneNumber' field is set and is not null
|
void |
mergeChanges(PhoneNumber 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.
|
PhoneNumber |
setCustomer(Reference customer)
Sets the field 'customer'.
|
PhoneNumber |
setId(String id)
Sets the field 'id'.
|
PhoneNumber |
setPhoneNumber(String phoneNumber)
Sets the field 'phoneNumber'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<PhoneNumber> CREATOR
public static final JSONifiable.Creator<PhoneNumber> JSON_CREATOR
public PhoneNumber()
protected PhoneNumber(boolean noInit)
public PhoneNumber(String json) throws IllegalArgumentException
IllegalArgumentException
public PhoneNumber(JSONObject jsonObject)
public PhoneNumber(PhoneNumber src)
public String getId()
public String getPhoneNumber()
public Reference getCustomer()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullPhoneNumber()
public boolean isNotNullCustomer()
public boolean hasId()
public boolean hasPhoneNumber()
public boolean hasCustomer()
public PhoneNumber setId(String id)
public PhoneNumber setPhoneNumber(String phoneNumber)
public PhoneNumber setCustomer(Reference customer)
public void clearId()
public void clearPhoneNumber()
public void clearCustomer()
public boolean containsChanges()
public void resetChangeLog()
public PhoneNumber copyChanges()
public void mergeChanges(PhoneNumber src)