Skip to content

Commit 0dbb460

Browse files
committed
Added as number and route in geolocation's response
1 parent 2fd2695 commit 0dbb460

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/main/java/io/ipgeolocation/api/Geolocation.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public class Geolocation {
3030
private String isp;
3131
private String connectionType;
3232
private String organization;
33+
private String asn;
34+
private String route;
3335
private String geonameID;
3436
private GeolocationCurrency currency;
3537
private GeolocationTimezone timezone;
@@ -64,6 +66,8 @@ public class Geolocation {
6466
this.isp = (String) json.get("isp");
6567
this.connectionType = (String) json.get("connection_type");
6668
this.organization = (String) json.get("organization");
69+
this.asn = (String) json.get("asn");
70+
this.route = (String) json.get("route");
6771
this.geonameID = (String) json.get("geoname_id");
6872
if(json.get("currency") instanceof LinkedTreeMap) {
6973
Map currencyJson = (LinkedTreeMap) json.get("currency");
@@ -177,6 +181,14 @@ public String getOrganization() {
177181
return organization;
178182
}
179183

184+
public String getAsn() {
185+
return asn;
186+
}
187+
188+
public String getRoute() {
189+
return route;
190+
}
191+
180192
public String getGeonameID() {
181193
return geonameID;
182194
}
@@ -202,6 +214,6 @@ public String toString() {
202214
timezoneString = timezone.toString();
203215
}
204216

205-
return String.format("domain: '%s' \nip: '%s' \nhostname: '%s' \ncontinent_code: '%s' \ncontinent_name: '%s' \ncountry_code2: '%s' \ncountry_code3: '%s' \ncountry_name: '%s' \ncountry_capital: '%s \nstate_prov: '%s' \ndistrict: '%s' \ncity: '%s' \nzipcode: '%s' \nlatitude: '%s' \nlongitude: '%s' \nis_eu: '%s' \ncalling_code: '%s' \ncountry_tld: '%s' \nlanguages: '%s' \ncountry_flag: '%s' \nisp: '%s' \nconnection_type: '%s' \norganization: '%s' \ngeoname_id: '%s' \ncurrency: {\n%s\n} \ntime_zone: {\n%s\n}\n", domain, ip, hostname, continentCode, continentName, countryCode2, countryCode3, countryName, countryCapital, stateProvince, district, city, zipCode, latitude, longitude, isEU, callingCode, countryTLD, languages, countryFlag, isp, connectionType, organization, geonameID, currencyString, timezoneString);
217+
return String.format("domain: '%s' \nip: '%s' \nhostname: '%s' \ncontinent_code: '%s' \ncontinent_name: '%s' \ncountry_code2: '%s' \ncountry_code3: '%s' \ncountry_name: '%s' \ncountry_capital: '%s \nstate_prov: '%s' \ndistrict: '%s' \ncity: '%s' \nzipcode: '%s' \nlatitude: '%s' \nlongitude: '%s' \nis_eu: '%s' \ncalling_code: '%s' \ncountry_tld: '%s' \nlanguages: '%s' \ncountry_flag: '%s' \nisp: '%s' \nconnection_type: '%s' \norganization: '%s' \ngeoname_id: '%s'\nasn: '%s' \nroute: '%s' \ncurrency: {\n%s\n} \ntime_zone: {\n%s\n}\n", domain, ip, hostname, continentCode, continentName, countryCode2, countryCode3, countryName, countryCapital, stateProvince, district, city, zipCode, latitude, longitude, isEU, callingCode, countryTLD, languages, countryFlag, isp, connectionType, organization, geonameID, asn, route, currencyString, timezoneString);
206218
}
207219
}

0 commit comments

Comments
 (0)