mirror of
https://github.com/ilri/cgspace-java-helpers.git
synced 2024-11-30 02:28:20 +01:00
Match alpha_2 and alpha_3 JSON elements with class
For GSON to automatically map these to our class we need to make sure they use the same name.
This commit is contained in:
parent
edd08c859a
commit
6995d7a864
@ -30,21 +30,21 @@ public class CountriesVocabulary {
|
|||||||
private String commonName; //optional
|
private String commonName; //optional
|
||||||
private String officialName; //optional
|
private String officialName; //optional
|
||||||
private String numeric; //required Hmmmm need to cast this...
|
private String numeric; //required Hmmmm need to cast this...
|
||||||
private String alpha2; //required
|
private String alpha_2; //required
|
||||||
private String alpha3; //required
|
private String alpha_3; //required
|
||||||
|
|
||||||
public Country(String name,
|
public Country(String name,
|
||||||
@Nullable String commonName,
|
@Nullable String commonName,
|
||||||
@Nullable String officialName,
|
@Nullable String officialName,
|
||||||
String numeric,
|
String numeric,
|
||||||
String alpha2,
|
String alpha_2,
|
||||||
String alpha3) {
|
String alpha_3) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.commonName = commonName;
|
this.commonName = commonName;
|
||||||
this.officialName = officialName;
|
this.officialName = officialName;
|
||||||
this.numeric = numeric; // fuuuuu this is a string and we can't cast to Integer because some values are zeropadded like "004"
|
this.numeric = numeric; // fuuuuu this is a string and we can't cast to Integer because some values are zeropadded like "004"
|
||||||
this.alpha2 = alpha2;
|
this.alpha_2 = alpha_2;
|
||||||
this.alpha3 = alpha3;
|
this.alpha_3 = alpha_3;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@ -63,12 +63,12 @@ public class CountriesVocabulary {
|
|||||||
return officialName;
|
return officialName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAlpha2() {
|
public String getAlpha_2() {
|
||||||
return alpha2;
|
return alpha_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAlpha3() {
|
public String getAlpha_3() {
|
||||||
return alpha3;
|
return alpha_3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user