|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.degreedays.api.data.Location
net.degreedays.api.data.GeographicLocation
net.degreedays.api.data.impl.PostalCodeLocation
public final class PostalCodeLocation
Specifies a location using a postal code (or zip code, post code, or postcode
- the terminology depends on the country). The API servers will attempt to
find the longitude/latitude location of the specified postal code, and from
that point on will treat the location as if it were a LongLatLocation
(see the notes for that class for more relevant information).
Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.
Constructor Summary | |
---|---|
PostalCodeLocation(java.lang.String postalCode,
java.lang.String twoLetterIsoCountryCodeInUpperCase)
Constructs a PostalCodeLocation object with a postal code
(or zip code, post code, or postcode) and a two-letter country code
representing the country that the postal code belongs to. |
Method Summary | |
---|---|
java.lang.String |
countryCode()
Returns the non-null two-letter upper-case ISO 3166-1-alpha-2 country code of the country that the postal code belongs to. |
java.lang.String |
postalCode()
Returns the non-null, non-empty postal code (or zip code, post code, or postcode - the terminology depends on the country). |
java.lang.String |
toString()
Returns a non-null, non-empty string representation of this object for logging and debugging purposes. |
Methods inherited from class net.degreedays.api.data.Location |
---|
equals, hashCode, longLat, postalCode, stationId |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PostalCodeLocation(java.lang.String postalCode, java.lang.String twoLetterIsoCountryCodeInUpperCase) throws java.lang.IllegalArgumentException
PostalCodeLocation
object with a postal code
(or zip code, post code, or postcode) and a two-letter country code
representing the country that the postal code belongs to.
postalCode
- the non-null, non-empty postal code (or zip code, post
code, or postcode) of the location you want data for. Cannot be
longer than 16 characters (a length that we believe allows for all
current postal codes worldwide), and cannot contain any characters
other than [- 0-9a-zA-Z]
.twoLetterIsoCountryCodeInUpperCase
- the ISO 3166-1-alpha-2 country code of the country that
postalCode
belongs to. It must be a two-character
string comprised of only characters A-Z (i.e. upper case only).
For example, pass "US" if postalCode
is a US zip
code, pass "GB" (for "Great Britain") if postalCode
is a UK post code, and pass "CA" if postalCode
is a
Canadian zip code.
java.lang.NullPointerException
- if postalCode
or
twoLetterIsoCountryCodeInUpperCase
is
null
.
java.lang.IllegalArgumentException
- if tests indicate that
postalCode
or
twoLetterIsoCountryCodeInUpperCase
fails to match
the specifications detailed above.Method Detail |
---|
public java.lang.String postalCode()
public java.lang.String countryCode()
public java.lang.String toString()
The exact details of the representation are unspecified and subject to change.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |