77public class Geolocation {
88 private Integer status ;
99 private String message ;
10+ private String domain ;
1011 private String ip ;
12+ private String hostname ;
1113 private String continentCode ;
1214 private String continentName ;
1315 private String countryCode2 ;
@@ -39,7 +41,9 @@ public class Geolocation {
3941 if (this .status != 200 || message != null ) {
4042 this .message = message ;
4143 } else {
44+ this .domain = (String ) json .get ("domain" );
4245 this .ip = (String ) json .get ("ip" );
46+ this .hostname = (String ) json .get ("hostname" );
4347 this .continentCode = (String ) json .get ("continent_code" );
4448 this .continentName = (String ) json .get ("continent_name" );
4549 this .countryCode2 = (String ) json .get ("country_code2" );
@@ -81,10 +85,18 @@ public String getMessage() {
8185 return message ;
8286 }
8387
88+ public String getDomain () {
89+ return domain ;
90+ }
91+
8492 public String getIPAddress () {
8593 return ip ;
8694 }
8795
96+ public String getHostname () {
97+ return hostname ;
98+ }
99+
88100 public String getContinentCode () {
89101 return continentCode ;
90102 }
@@ -190,6 +202,6 @@ public String toString() {
190202 timezoneString = timezone .toString ();
191203 }
192204
193- return String .format ("ip : '%s' \n continent_code: '%s' \n continent_name: '%s' \n country_code2: '%s' \n country_code3: '%s' \n country_name: '%s' \n country_capital: '%s \n state_prov: '%s' \n district: '%s' \n city: '%s' \n zipcode: '%s' \n latitude: '%s' \n longitude: '%s' \n is_eu: '%s' \n calling_code: '%s' \n country_tld: '%s' \n languages: '%s' \n country_flag: '%s' \n isp: '%s' \n connection_type: '%s' \n organization: '%s' \n geoname_id: '%s' \n currency: {\n %s\n } \n time_zone: {\n %s\n }\n " , ip , continentCode , continentName , countryCode2 , countryCode3 , countryName , countryCapital , stateProvince , district , city , zipCode , latitude , longitude , isEU , callingCode , countryTLD , languages , countryFlag , isp , connectionType , organization , geonameID , currencyString , timezoneString );
205+ return String .format ("domain : '%s' \n ip: '%s' \n hostname: '%s' \ n continent_code: '%s' \n continent_name: '%s' \n country_code2: '%s' \n country_code3: '%s' \n country_name: '%s' \n country_capital: '%s \n state_prov: '%s' \n district: '%s' \n city: '%s' \n zipcode: '%s' \n latitude: '%s' \n longitude: '%s' \n is_eu: '%s' \n calling_code: '%s' \n country_tld: '%s' \n languages: '%s' \n country_flag: '%s' \n isp: '%s' \n connection_type: '%s' \n organization: '%s' \n geoname_id: '%s' \n currency: {\n %s\n } \n time_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 );
194206 }
195- }
207+ }
0 commit comments