|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.ManagedReferenceHolder
org.starhope.appius.sql.SQLPeerDatum
org.starhope.appius.mb.UserAddress
public class UserAddress
Field Summary | |
---|---|
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 |
postalCode
|
private String |
province
|
private static long |
serialVersionUID
|
private String |
title
|
private Person |
user
|
private String |
validatedByDomain
|
private Date |
validatedOn
|
private String |
zipPlus4
|
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()
|
String |
getMail()
|
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 externallyValidated)
|
void |
setIntitude(BigDecimal longitude)
|
void |
setLatitude(BigDecimal latitude)
|
void |
setLocality(String locality)
|
void |
setMail(String newMail)
|
void |
setPostalCode(String newPostalCode)
|
void |
setProvince(String newProvince)
|
void |
setTitle(String newTitle)
|
void |
setUser(Person newUser)
|
void |
setValidatedByDomain(String validatedByDomain)
|
void |
setValidatedOn(Date validated)
|
void |
setZipPlus4(String newZipPlus4)
|
org.json.JSONObject |
toJSON()
This is an overriding method. |
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, findInCache, get, prepare, prepare, saveInCache |
Methods inherited from class org.starhope.appius.util.ManagedReferenceHolder |
---|
deref, setRef |
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 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 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
CastsToJSON.set(org.json.JSONObject)
protected void set(ResultSet rs) throws SQLException
set
in class SQLPeerDatum
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 externallyValidated)
externallyValidated
- the externallyValidated to setpublic void setIntitude(BigDecimal longitude)
longitude
- the longitude to setpublic void setLatitude(BigDecimal latitude)
latitude
- the latitude to setpublic void setLocality(String locality)
public void setMail(String newMail)
newMail
- newPostalCode
- the postal/ZIP code of the addresspublic 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 validatedByDomain)
validatedByDomain
- 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |