|
||||||||||
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
Street address (or similar), line 1 (of 2) |
private String |
address2
Street address (or similar), line 2 (of 2) |
private String |
addressType
The type of location described; might be e.g. |
private String |
city
The city, town, village, &c. |
private String |
country
The 2-digit ISO country code |
private int |
database_id
The unique ID for storing this address into the database (if so stored) |
private BigDecimal |
latitude
if known, the latitude of the address |
private String |
locality
the locality or other subdivisional indicia of the address |
private BigDecimal |
longitude
if known, the longitude of the address |
private String |
mail
an eMail address |
private String |
phone
a telephone number with local formatting as desired |
private String |
postalCode
The postal or ZIP code. |
private String |
province
The state or province |
private static long |
serialVersionUID
Java serializations user ID |
private String |
title
A user-selected title for convenience of user selection of an address from a collection |
private AbstractPerson |
user
The user affiliated with this address |
private String |
validatedByDomain
The Internet Domain Name of the service used for validation (e.g. |
private Date |
validatedOn
The date of validation, if this address has been externally validated; else, null |
private String |
zipPlus4
WRITEME |
Constructor Summary | |
---|---|
UserAddress(String addressFirst,
String addressSecond,
String theCity,
String stateProvinceOrLocality,
String theCountry,
String thePostalCode,
String phoneNumber,
String electronicMail)
WRITEME: Document this constructor brpocock@star-hope.org |
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()
WRITEME: document this method (brpocock@star-hope.org, Sep 24, 2009) |
String |
getMail()
|
String |
getPhone()
WRITEME: document this method (brpocock@star-hope.org, Sep 24, 2009) |
String |
getPostalCode()
|
String |
getPropertyNumber()
|
String |
getProvince()
|
String |
getStreetName()
|
String |
getStreetType()
|
String |
getTitle()
|
AbstractPerson |
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 |
setLatitude(BigDecimal latitude1)
|
void |
setLocality(String locality1)
WRITEME: document this method (brpocock@star-hope.org, Sep 23, 2009) |
void |
setLongitude(BigDecimal longitude1)
|
void |
setMail(String newMail)
|
void |
setPhone(String phone1)
WRITEME: document this method (brpocock@star-hope.org, Sep 23, 2009) |
void |
setPostalCode(String newPostalCode)
|
void |
setProvince(String newProvince)
|
void |
setTitle(String newTitle)
|
void |
setUser(AbstractPerson newUser)
|
void |
setValidatedByDomain(String validatedByDomain1)
|
void |
setValidatedOn(Date validated)
|
void |
setZipPlus4(String newZipPlus4)
|
org.json.JSONObject |
toJSON()
This is an overriding method. |
boolean |
validate()
This method should validate the supplied address by passing it through a geocoding service or similar methods. |
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, compareTo, 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
address2
private String address2
address
private String addressType
private String city
private String country
private final int database_id
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 AbstractPerson user
private String validatedByDomain
private Date validatedOn
private String zipPlus4
Constructor Detail |
---|
public UserAddress(String addressFirst, String addressSecond, String theCity, String stateProvinceOrLocality, String theCountry, String thePostalCode, String phoneNumber, String electronicMail)
addressFirst
- WRITEMEaddressSecond
- WRITEMEtheCity
- WRITEMEstateProvinceOrLocality
- WRITEMEtheCountry
- WRITEMEthePostalCode
- WRITEMEphoneNumber
- WRITEMEelectronicMail
- WRITEMEMethod 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 AbstractPerson 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
objectorg.starhope.appius.util.CastsToJSON#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 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(AbstractPerson 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 |