Version | |
Download | 19 |
Stock | ∞ |
File Size | 1.87 KB |
Create Date | August 11, 2016 |
Download |
Description of POJO Classes for REST Countries
The download link contains a zip file of POJO classes for REST Countries; you will need for Retrofit Android Web Services. You will only need to add the package information for your project on the top of Java files to use in your Android Countries Information Web Services Project while using Gson library. You can also generate POJO files from JSONSchema2POJO. Paste the JSON format data in the editor, Set Source Type to JSON and Annotation Style to Gson and Download the zip files from the ZIP button at the bottom of the page.
Click here to learn how to use Retrofit with Gson in Andorid
Don't forget to remove the generated annotations from the code and its import. It sometimes generates errors.
CountriesInfo.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 |
import java.util.ArrayList; import java.util.List; import javax.annotation.Generated; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @Generated("org.jsonschema2pojo") public class CountriesInfo { @SerializedName("name") @Expose private String name; @SerializedName("capital") @Expose private String capital; @SerializedName("altSpellings") @Expose private List<String> altSpellings = new ArrayList<String>(); @SerializedName("relevance") @Expose private String relevance; @SerializedName("region") @Expose private String region; @SerializedName("subregion") @Expose private String subregion; @SerializedName("translations") @Expose private Translations translations; @SerializedName("population") @Expose private Integer population; @SerializedName("latlng") @Expose private List<Double> latlng = new ArrayList<Double>(); @SerializedName("demonym") @Expose private String demonym; @SerializedName("area") @Expose private Double area; @SerializedName("gini") @Expose private Double gini; @SerializedName("timezones") @Expose private List<String> timezones = new ArrayList<String>(); @SerializedName("borders") @Expose private List<String> borders = new ArrayList<String>(); @SerializedName("nativeName") @Expose private String nativeName; @SerializedName("callingCodes") @Expose private List<String> callingCodes = new ArrayList<String>(); @SerializedName("topLevelDomain") @Expose private List<String> topLevelDomain = new ArrayList<String>(); @SerializedName("alpha2Code") @Expose private String alpha2Code; @SerializedName("alpha3Code") @Expose private String alpha3Code; @SerializedName("currencies") @Expose private List<String> currencies = new ArrayList<String>(); @SerializedName("languages") @Expose private List<String> languages = new ArrayList<String>(); /** * * @return * The name */ public String getName() { return name; } /** * * @param name * The name */ public void setName(String name) { this.name = name; } /** * * @return * The capital */ public String getCapital() { return capital; } /** * * @param capital * The capital */ public void setCapital(String capital) { this.capital = capital; } /** * * @return * The altSpellings */ public List<String> getAltSpellings() { return altSpellings; } /** * * @param altSpellings * The altSpellings */ public void setAltSpellings(List<String> altSpellings) { this.altSpellings = altSpellings; } /** * * @return * The relevance */ public String getRelevance() { return relevance; } /** * * @param relevance * The relevance */ public void setRelevance(String relevance) { this.relevance = relevance; } /** * * @return * The region */ public String getRegion() { return region; } /** * * @param region * The region */ public void setRegion(String region) { this.region = region; } /** * * @return * The subregion */ public String getSubregion() { return subregion; } /** * * @param subregion * The subregion */ public void setSubregion(String subregion) { this.subregion = subregion; } /** * * @return * The translations */ public Translations getTranslations() { return translations; } /** * * @param translations * The translations */ public void setTranslations(Translations translations) { this.translations = translations; } /** * * @return * The population */ public Integer getPopulation() { return population; } /** * * @param population * The population */ public void setPopulation(Integer population) { this.population = population; } /** * * @return * The latlng */ public List<Double> getLatlng() { return latlng; } /** * * @param latlng * The latlng */ public void setLatlng(List<Double> latlng) { this.latlng = latlng; } /** * * @return * The demonym */ public String getDemonym() { return demonym; } /** * * @param demonym * The demonym */ public void setDemonym(String demonym) { this.demonym = demonym; } /** * * @return * The area */ public Double getArea() { return area; } /** * * @param area * The area */ public void setArea(Double area) { this.area = area; } /** * * @return * The gini */ public Double getGini() { return gini; } /** * * @param gini * The gini */ public void setGini(Double gini) { this.gini = gini; } /** * * @return * The timezones */ public List<String> getTimezones() { return timezones; } /** * * @param timezones * The timezones */ public void setTimezones(List<String> timezones) { this.timezones = timezones; } /** * * @return * The borders */ public List<String> getBorders() { return borders; } /** * * @param borders * The borders */ public void setBorders(List<String> borders) { this.borders = borders; } /** * * @return * The nativeName */ public String getNativeName() { return nativeName; } /** * * @param nativeName * The nativeName */ public void setNativeName(String nativeName) { this.nativeName = nativeName; } /** * * @return * The callingCodes */ public List<String> getCallingCodes() { return callingCodes; } /** * * @param callingCodes * The callingCodes */ public void setCallingCodes(List<String> callingCodes) { this.callingCodes = callingCodes; } /** * * @return * The topLevelDomain */ public List<String> getTopLevelDomain() { return topLevelDomain; } /** * * @param topLevelDomain * The topLevelDomain */ public void setTopLevelDomain(List<String> topLevelDomain) { this.topLevelDomain = topLevelDomain; } /** * * @return * The alpha2Code */ public String getAlpha2Code() { return alpha2Code; } /** * * @param alpha2Code * The alpha2Code */ public void setAlpha2Code(String alpha2Code) { this.alpha2Code = alpha2Code; } /** * * @return * The alpha3Code */ public String getAlpha3Code() { return alpha3Code; } /** * * @param alpha3Code * The alpha3Code */ public void setAlpha3Code(String alpha3Code) { this.alpha3Code = alpha3Code; } /** * * @return * The currencies */ public List<String> getCurrencies() { return currencies; } /** * * @param currencies * The currencies */ public void setCurrencies(List<String> currencies) { this.currencies = currencies; } /** * * @return * The languages */ public List<String> getLanguages() { return languages; } /** * * @param languages * The languages */ public void setLanguages(List<String> languages) { this.languages = languages; } } |
Translations.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
import javax.annotation.Generated; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @Generated("org.jsonschema2pojo") public class Translations { @SerializedName("de") @Expose private String de; @SerializedName("es") @Expose private String es; @SerializedName("fr") @Expose private String fr; @SerializedName("ja") @Expose private String ja; @SerializedName("it") @Expose private String it; /** * * @return * The de */ public String getDe() { return de; } /** * * @param de * The de */ public void setDe(String de) { this.de = de; } /** * * @return * The es */ public String getEs() { return es; } /** * * @param es * The es */ public void setEs(String es) { this.es = es; } /** * * @return * The fr */ public String getFr() { return fr; } /** * * @param fr * The fr */ public void setFr(String fr) { this.fr = fr; } /** * * @return * The ja */ public String getJa() { return ja; } /** * * @param ja * The ja */ public void setJa(String ja) { this.ja = ja; } /** * * @return * The it */ public String getIt() { return it; } /** * * @param it * The it */ public void setIt(String it) { this.it = it; } } |