Package com.clover.sdk.v3.customers
Class Address
- java.lang.Object
-
- com.clover.sdk.GenericParcelable
-
- com.clover.sdk.v3.customers.Address
-
- All Implemented Interfaces:
Parcelable
,JSONifiable
,Validator
public class Address extends GenericParcelable implements Validator, JSONifiable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Address.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<Address>
CREATOR
static JSONifiable.Creator<Address>
JSON_CREATOR
-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor Description Address()
Constructs a new empty instance.protected
Address(boolean noInit)
Constructs a new empty instance.Address(Address src)
Constructs a new instance that is a deep copy of the source instance.Address(String json)
Constructs a new instance from the given JSON String.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAddress1()
Clears the 'address1' field, the 'has' method for this field will now return falsevoid
clearAddress2()
Clears the 'address2' field, the 'has' method for this field will now return falsevoid
clearAddress3()
Clears the 'address3' field, the 'has' method for this field will now return falsevoid
clearCity()
Clears the 'city' field, the 'has' method for this field will now return falsevoid
clearCountry()
Clears the 'country' field, the 'has' method for this field will now return falsevoid
clearCustomer()
Clears the 'customer' field, the 'has' method for this field will now return falsevoid
clearId()
Clears the 'id' field, the 'has' method for this field will now return falsevoid
clearState()
Clears the 'state' field, the 'has' method for this field will now return falsevoid
clearZip()
Clears the 'zip' field, the 'has' method for this field will now return falseboolean
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()
Reference
getCustomer()
Customer who this address 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
getState()
String
getZip()
boolean
hasAddress1()
Checks whether the 'address1' field has been set, however the value could be nullboolean
hasAddress2()
Checks whether the 'address2' field has been set, however the value could be nullboolean
hasAddress3()
Checks whether the 'address3' field has been set, however the value could be nullboolean
hasCity()
Checks whether the 'city' field has been set, however the value could be nullboolean
hasCountry()
Checks whether the 'country' field has been set, however the value could be nullboolean
hasCustomer()
Checks whether the 'customer' field has been set, however the value could be nullboolean
hasId()
Checks whether the 'id' field has been set, however the value could be nullboolean
hasState()
Checks whether the 'state' field has been set, however the value could be nullboolean
hasZip()
Checks whether the 'zip' field has been set, however the value could be nullboolean
isNotNullAddress1()
Checks whether the 'address1' field is set and is not nullboolean
isNotNullAddress2()
Checks whether the 'address2' field is set and is not nullboolean
isNotNullAddress3()
Checks whether the 'address3' field is set and is not nullboolean
isNotNullCity()
Checks whether the 'city' field is set and is not nullboolean
isNotNullCountry()
Checks whether the 'country' field is set and is not nullboolean
isNotNullCustomer()
Checks whether the 'customer' field is set and is not nullboolean
isNotNullId()
Checks whether the 'id' field is set and is not nullboolean
isNotNullState()
Checks whether the 'state' field is set and is not nullboolean
isNotNullZip()
Checks whether the 'zip' field is set and is not nullvoid
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
setCustomer(Reference customer)
Sets the field 'customer'.Address
setId(String id)
Sets the field 'id'.Address
setState(String state)
Sets the field 'state'.Address
setZip(String zip)
Sets the field 'zip'.void
validate()
-
Methods inherited from class com.clover.sdk.GenericParcelable
describeContents, getBundle, toString, writeToParcel
-
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<Address> CREATOR
-
JSON_CREATOR
public static final JSONifiable.Creator<Address> JSON_CREATOR
-
-
Constructor Detail
-
Address
public Address()
Constructs a new empty instance.
-
Address
protected Address(boolean noInit)
Constructs a new empty instance.
-
Address
public Address(String json) throws IllegalArgumentException
Constructs a new instance from the given JSON String.- Throws:
IllegalArgumentException
-
Address
public 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
public Address(Address src)
Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
-
-
Method Detail
-
getId
public String getId()
-
getAddress1
public String getAddress1()
-
getAddress2
public String getAddress2()
-
getAddress3
public String getAddress3()
-
getCity
public String getCity()
-
getCountry
public String getCountry()
-
getState
public String getState()
-
getZip
public String getZip()
-
getCustomer
public Reference getCustomer()
Customer who this address belongs to.
-
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
-
isNotNullId
public boolean isNotNullId()
Checks whether the 'id' field is set and is not null
-
isNotNullAddress1
public boolean isNotNullAddress1()
Checks whether the 'address1' field is set and is not null
-
isNotNullAddress2
public boolean isNotNullAddress2()
Checks whether the 'address2' field is set and is not null
-
isNotNullAddress3
public boolean isNotNullAddress3()
Checks whether the 'address3' field is set and is not null
-
isNotNullCity
public boolean isNotNullCity()
Checks whether the 'city' field is set and is not null
-
isNotNullCountry
public boolean isNotNullCountry()
Checks whether the 'country' field is set and is not null
-
isNotNullState
public boolean isNotNullState()
Checks whether the 'state' field is set and is not null
-
isNotNullZip
public boolean isNotNullZip()
Checks whether the 'zip' field is set and is not null
-
isNotNullCustomer
public boolean isNotNullCustomer()
Checks whether the 'customer' field is set and is not null
-
hasId
public boolean hasId()
Checks whether the 'id' field has been set, however the value could be null
-
hasAddress1
public boolean hasAddress1()
Checks whether the 'address1' field has been set, however the value could be null
-
hasAddress2
public boolean hasAddress2()
Checks whether the 'address2' field has been set, however the value could be null
-
hasAddress3
public boolean hasAddress3()
Checks whether the 'address3' field has been set, however the value could be null
-
hasCity
public boolean hasCity()
Checks whether the 'city' field has been set, however the value could be null
-
hasCountry
public boolean hasCountry()
Checks whether the 'country' field has been set, however the value could be null
-
hasState
public boolean hasState()
Checks whether the 'state' field has been set, however the value could be null
-
hasZip
public boolean hasZip()
Checks whether the 'zip' field has been set, however the value could be null
-
hasCustomer
public boolean hasCustomer()
Checks whether the 'customer' field has been set, however the value could be null
-
setCustomer
public Address setCustomer(Reference customer)
Sets the field 'customer'. The parameter is not copied so changes to it will be reflected in this instance and vice-versa.
-
clearId
public void clearId()
Clears the 'id' field, the 'has' method for this field will now return false
-
clearAddress1
public void clearAddress1()
Clears the 'address1' field, the 'has' method for this field will now return false
-
clearAddress2
public void clearAddress2()
Clears the 'address2' field, the 'has' method for this field will now return false
-
clearAddress3
public void clearAddress3()
Clears the 'address3' field, the 'has' method for this field will now return false
-
clearCity
public void clearCity()
Clears the 'city' field, the 'has' method for this field will now return false
-
clearCountry
public void clearCountry()
Clears the 'country' field, the 'has' method for this field will now return false
-
clearState
public void clearState()
Clears the 'state' field, the 'has' method for this field will now return false
-
clearZip
public void clearZip()
Clears the 'zip' field, the 'has' method for this field will now return false
-
clearCustomer
public void clearCustomer()
Clears the 'customer' 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 Address copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
-
mergeChanges
public void mergeChanges(Address src)
Copy all the changed fields from the given source to this instance.
-
-