public class Address extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
Address.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<Address> |
CREATOR |
static JSONifiable.Creator<Address> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
Address()
Constructs a new empty instance.
|
|
Address(Address src)
Constructs a new instance that is a deep copy of the source instance.
|
protected |
Address(boolean noInit)
Constructs a new empty instance.
|
|
Address(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.
|
|
Address(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAddress1()
Clears the 'address1' field, the 'has' method for this field will now return false
|
void |
clearAddress2()
Clears the 'address2' field, the 'has' method for this field will now return false
|
void |
clearAddress3()
Clears the 'address3' field, the 'has' method for this field will now return false
|
void |
clearCity()
Clears the 'city' field, the 'has' method for this field will now return false
|
void |
clearCountry()
Clears the 'country' 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
|
void |
clearState()
Clears the 'state' field, the 'has' method for this field will now return false
|
void |
clearZip()
Clears the 'zip' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
Address |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
String |
getAddress1() |
String |
getAddress2() |
String |
getAddress3() |
String |
getCity() |
String |
getCountry() |
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.
|
String |
getPhoneNumber() |
String |
getState() |
String |
getZip() |
boolean |
hasAddress1()
Checks whether the 'address1' field has been set, however the value could be null
|
boolean |
hasAddress2()
Checks whether the 'address2' field has been set, however the value could be null
|
boolean |
hasAddress3()
Checks whether the 'address3' field has been set, however the value could be null
|
boolean |
hasCity()
Checks whether the 'city' field has been set, however the value could be null
|
boolean |
hasCountry()
Checks whether the 'country' 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 |
hasState()
Checks whether the 'state' field has been set, however the value could be null
|
boolean |
hasZip()
Checks whether the 'zip' field has been set, however the value could be null
|
boolean |
isNotNullAddress1()
Checks whether the 'address1' field is set and is not null
|
boolean |
isNotNullAddress2()
Checks whether the 'address2' field is set and is not null
|
boolean |
isNotNullAddress3()
Checks whether the 'address3' field is set and is not null
|
boolean |
isNotNullCity()
Checks whether the 'city' field is set and is not null
|
boolean |
isNotNullCountry()
Checks whether the 'country' field is set and is not null
|
boolean |
isNotNullPhoneNumber()
Checks whether the 'phoneNumber' field is set and is not null
|
boolean |
isNotNullState()
Checks whether the 'state' field is set and is not null
|
boolean |
isNotNullZip()
Checks whether the 'zip' field is set and is not null
|
void |
mergeChanges(Address 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.
|
Address |
setAddress1(String address1)
Sets the field 'address1'.
|
Address |
setAddress2(String address2)
Sets the field 'address2'.
|
Address |
setAddress3(String address3)
Sets the field 'address3'.
|
Address |
setCity(String city)
Sets the field 'city'.
|
Address |
setCountry(String country)
Sets the field 'country'.
|
Address |
setPhoneNumber(String phoneNumber)
Sets the field 'phoneNumber'.
|
Address |
setState(String state)
Sets the field 'state'.
|
Address |
setZip(String zip)
Sets the field 'zip'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<Address> CREATOR
public static final JSONifiable.Creator<Address> JSON_CREATOR
public Address()
protected Address(boolean noInit)
public Address(String json) throws IllegalArgumentException
IllegalArgumentException
public Address(JSONObject jsonObject)
public Address(Address src)
public String getAddress1()
public String getAddress2()
public String getAddress3()
public String getCity()
public String getCountry()
public String getPhoneNumber()
public String getState()
public String getZip()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullAddress1()
public boolean isNotNullAddress2()
public boolean isNotNullAddress3()
public boolean isNotNullCity()
public boolean isNotNullCountry()
public boolean isNotNullPhoneNumber()
public boolean isNotNullState()
public boolean isNotNullZip()
public boolean hasAddress1()
public boolean hasAddress2()
public boolean hasAddress3()
public boolean hasCity()
public boolean hasCountry()
public boolean hasPhoneNumber()
public boolean hasState()
public boolean hasZip()
public void clearAddress1()
public void clearAddress2()
public void clearAddress3()
public void clearCity()
public void clearCountry()
public void clearPhoneNumber()
public void clearState()
public void clearZip()
public boolean containsChanges()
public void resetChangeLog()
public Address copyChanges()
public void mergeChanges(Address src)