public class LookupResult { private String ipAddress; private String continentCode; private String continentName; private String countryCode; private String countryName; private String subdivisionCode; private String subdivisionName; private String city; private String postalCode; private double latitude; private double longitude; public LookupResult() { super(); } public String getIPAddress() { return ipAddress; } void setIPAddress(String ipAddress) { this.ipAddress = ipAddress; } /** * @return A two character continent code like "NA" (North America) or "OC" * (Oceania). This attribute is returned by all end points. */ public String getContinentCode() { return continentCode; } void setContinentCode(String continentCode) { this.continentCode = continentCode; } /** * @return The continent name associated with an IP address. This attribute * is returned by all the end points. */ public String getContinentName() { return continentName; } void setContinentName(String continentName) { this.continentName = continentName; } /** * @return The <a * href="http://en.wikipedia.org/wiki/ISO_3166-1">two-character ISO * 3166-1 alpha code</a> for the country. This attribute is returned * by all end points. */ public String getCountryCode() { return countryCode; } void setCountryCode(String countryCode) { this.countryCode = countryCode; } /** * @return The country name associated with an IP address. This attribute is * returned by all the end points. */ public String getCountryName() { return countryName; } void setCountryName(String countryName) { this.countryName = countryName; } /** * @return This is a string up to three characters long contain the * subdivision portion of the <a * href="http://en.wikipedia.org/wiki/ISO_3166-2 ISO 3166-2" * >code</a>. This attribute is returned by all end points except * Country. */ public String getSubdivisionCode() { return subdivisionCode; } void setSubdivisionCode(String subdivisionCode) { this.subdivisionCode = subdivisionCode; } /** * @return The subdivision name associated with an IP address. This * attribute is returned by all the end points except the Country * end point. */ public String getSubdivisionName() { return subdivisionName; } void setSubdivisionName(String subdivisionName) { this.subdivisionName = subdivisionName; } /** * @return The city associated with an IP address. This attribute is * returned by all the end points except the Country end point. */ public String getCity() { return city; } void setCity(String city) { this.city = city; } /** * @return The city associated with an IP address. This attribute is * returned by all the end points except the Country end point. */ public String getPostalCode() { return postalCode; } void setPostalCode(String postalCode) { this.postalCode = postalCode; } /** * @return The latitude of the location as a floating point number. This * attribute is returned by all end points except the Country end * point. */ public double getLatitude() { return latitude; } void setLatitude(double latitude) { this.latitude = latitude; } /** * @return The longitude of the location as a floating point number. This * attribute is returned by all end points except the Country end * point. */ public double getLongitude() { return longitude; } void setLongitude(double longitude) { this.longitude = longitude; } public String toSring() { String LS = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(); sb.append(super.toString()).append(" {").append(LS); sb.append('\t'); sb.append("ipAddress: \"").append(ipAddress).append('"').append(LS); sb.append('\t'); sb.append("countryCode: \"").append(countryCode).append('"').append(LS); sb.append('\t'); sb.append("countryName: \"").append(countryName).append('"').append(LS); sb.append('\t'); sb.append("subdivisionCode: \"").append(subdivisionCode).append('"'); sb.append(LS).append('\t'); sb.append("subdivisionName: \"").append(subdivisionName).append('"'); sb.append(LS).append('\t'); sb.append("city: \"").append(city).append('"').append(LS); sb.append('\t'); sb.append("postalCode: \"").append(postalCode).append('"').append(LS); sb.append('\t'); sb.append("latitude: ").append(latitude).append(LS); sb.append('\t'); sb.append("longitude: ").append(longitude).append(LS); sb.append('}'); return sb.toString(); } } |