|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.sql.SQLPeerDatum
org.starhope.appius.mb.UserAddress
public class UserAddress
Field Summary | |
---|---|
private String |
address
WRITEME |
private String |
address2
WRITEME |
private String |
addressType
WRITEME |
private String |
city
WRITEME |
private String |
country
WRITEME |
private int |
database_id
WRITEME |
private boolean |
externallyValidated
WRITEME |
private BigDecimal |
latitude
WRITEME |
private String |
locality
WRITEME |
private BigDecimal |
longitude
WRITEME |
private String |
mail
WRITEME |
private String |
phone
WRITEME |
private String |
postalCode
WRITEME |
private String |
province
WRITEME |
private static long |
serialVersionUID
|
private String |
title
WRITEME |
private Person |
user
WRITEME |
private String |
validatedByDomain
WRITEME |
private Date |
validatedOn
WRITEME |
private String |
zipPlus4
WRITEME |
Constructor Summary | |
---|---|
UserAddress()
|
Method Summary | |
---|---|
void |
asyncValidate()
Request an asynchronous validation against some online service or other (Google, Yahoo, whoever) |
boolean |
equals(String streetAddress,
String otherCity,
String otherProvince,
String otherPostalCode,
String otherCountry)
Convenience method, to match up against the address fields as provided by Authorize.Net. |
void |
flush()
This is an overriding method. |
static UserAddress |
get(org.json.JSONObject object)
|
String |
getAddress()
|
String |
getAddress2()
|
String |
getAddressPair()
|
String |
getAddressType()
|
String |
getApartment()
|
protected String |
getCacheUniqueID()
|
String |
getCity()
|
String |
getCountry()
|
BigDecimal |
getIntitude()
|
BigDecimal |
getLatitude()
|
String |
getLocality()
TODO: document this method (brpocock, Sep 24, 2009) |
String |
getMail()
|
String |
getPhone()
TODO: document this method (brpocock, Sep 24, 2009) |
String |
getPostalCode()
|
String |
getPropertyNumber()
|
String |
getProvince()
|
String |
getStreetName()
|
String |
getStreetType()
|
String |
getTitle()
|
Person |
getUser()
|
String |
getValidatedByDomain()
|
Date |
getValidatedOn()
|
String |
getZipPlus4()
|
boolean |
isExternallyValidated()
|
boolean |
isValidAddress()
This method determines whether the supplied address is plausible to be valid. |
void |
set(org.json.JSONObject o)
|
protected void |
set(ResultSet rs)
This is an overriding method. |
void |
setAddress(String newAddress,
String newAddress2)
|
void |
setAddressType(String newAddressType)
|
void |
setCity(String newCity)
|
void |
setCountry(String newCountry)
|
void |
setExternallyValidated(boolean externallyValidated1)
|
void |
setLatitude(BigDecimal latitude1)
|
void |
setLocality(String locality1)
TODO: document this method (brpocock, Sep 23, 2009) |
void |
setLongitude(BigDecimal longitude1)
|
void |
setMail(String newMail)
|
void |
setPhone(String phone1)
TODO: document this method (brpocock, Sep 23, 2009) |
void |
setPostalCode(String newPostalCode)
|
void |
setProvince(String newProvince)
|
void |
setTitle(String newTitle)
|
void |
setUser(Person newUser)
|
void |
setValidatedByDomain(String validatedByDomain1)
|
void |
setValidatedOn(Date validated)
|
void |
setZipPlus4(String newZipPlus4)
|
org.json.JSONObject |
toJSON()
This is an overriding method. |
boolean |
validate()
WRITEME: document method. |
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, findInCache, get, saveInCache |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private String address
private String address2
private String addressType
private String city
private String country
private int database_id
private boolean externallyValidated
private BigDecimal latitude
private String locality
private BigDecimal longitude
private String mail
private String phone
private String postalCode
private String province
private String title
private Person user
private String validatedByDomain
private Date validatedOn
private String zipPlus4
Constructor Detail |
---|
public UserAddress()
Method Detail |
---|
public static UserAddress get(org.json.JSONObject object) throws NotFoundException, org.json.JSONException
object
- The JSON object containing the reference to an
address
NotFoundException
- if the address couldn't be found in the
database sense. (Does not necessarily mean that the
address exists IRL)
org.json.JSONException
- if the JSON data couldn't be decoded
properlypublic void asyncValidate()
public boolean equals(String streetAddress, String otherCity, String otherProvince, String otherPostalCode, String otherCountry)
Convenience method, to match up against the address fields as provided by Authorize.Net. Plus, it might come in useful in other contexts as well.
Note that this method doesn't care about address line two, but it's quite strict on the rest. It would actually make sense to run both addresses through some minimal degree of conformance first, but that's outside the current SOW. TODO?
streetAddress
- streetAddressotherCity
- cityotherProvince
- province/stateotherPostalCode
- postal/ZIP codeotherCountry
- country
public void flush()
flush
in class SQLPeerDatum
SQLPeerDatum.flush()
public String getAddress()
public String getAddress2()
public String getAddressPair()
public String getAddressType()
public String getApartment()
protected String getCacheUniqueID()
getCacheUniqueID
in class SQLPeerDatum
SQLPeerDatum.getCacheUniqueID()
public String getCity()
public String getCountry()
public BigDecimal getIntitude()
public BigDecimal getLatitude()
public String getLocality()
public String getMail()
public String getPhone()
public String getPostalCode()
public String getPropertyNumber()
public String getProvince()
public String getStreetName()
public String getStreetType()
public String getTitle()
public Person getUser()
public String getValidatedByDomain()
public Date getValidatedOn()
public String getZipPlus4()
public boolean isExternallyValidated()
public boolean isValidAddress()
public void set(org.json.JSONObject o)
set
in class SQLPeerDatum
o
- The JSON data to be used to set the value of this
objectCastsToJSON.set(org.json.JSONObject)
protected void set(ResultSet rs) throws SQLException
set
in class SQLPeerDatum
rs
- The result of an SQL query, with the cursor already
pointed at the row describing this specific instance
of the object.
SQLException
- if the database fails somehowSQLPeerDatum.set(java.sql.ResultSet)
public void setAddress(String newAddress, String newAddress2)
newAddress
- the first line of the addressnewAddress2
- the second linepublic void setAddressType(String newAddressType)
newAddressType
- the type of the addresspublic void setCity(String newCity)
newCity
- the city/town/village part of the addresspublic void setCountry(String newCountry)
newCountry
- the country code for the addresspublic void setExternallyValidated(boolean externallyValidated1)
externallyValidated1
- the externallyValidated to setpublic void setLatitude(BigDecimal latitude1)
latitude1
- the latitude to setpublic void setLocality(String locality1)
locality1
- WRITEMEpublic void setLongitude(BigDecimal longitude1)
longitude1
- the longitude to setpublic void setMail(String newMail)
newMail
- WRITEMEpublic void setPhone(String phone1)
phone1
- WRITEMEpublic void setPostalCode(String newPostalCode)
newPostalCode
- the postal/ZIP code of the addresspublic void setProvince(String newProvince)
newProvince
- the province/state/locality of the addresspublic void setTitle(String newTitle)
newTitle
- the user-visible title of the addresspublic void setUser(Person newUser)
newUser
- the user whose address this ispublic void setValidatedByDomain(String validatedByDomain1)
validatedByDomain1
- the validatedByDomain to setpublic void setValidatedOn(Date validated)
validated
- the validated to setpublic void setZipPlus4(String newZipPlus4)
newZipPlus4
- the ZIP+4 code for a US addresspublic org.json.JSONObject toJSON()
toJSON
in class SQLPeerDatum
SQLPeerDatum.toJSON()
public boolean validate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |