Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class Country implements KeyedNode {
private static final String CURRENCIES = "currencies";

private final Set<Currency> mCurrencies;

private final String mDefaultCurrencyCode;
private final String mCode;
private final MappedConnection<Currency> mCurrencyMappedConnection;
private final String mName;
Expand All @@ -52,6 +54,7 @@ public Country(@NonNull final JSONObject country) throws JSONException, NoSuchMe
mCode = country.optString(COUNTRY_CODE);
mName = country.optString(COUNTRY_NAME);
mCurrencies = new LinkedHashSet<>(1);
mDefaultCurrencyCode = country.optString("defaultCurrencyCode");
JSONObject currencies = country.optJSONObject(CURRENCIES);
if (currencies != null && currencies.length() != 0) {
mCurrencyMappedConnection = new MappedConnection<>(currencies, Currency.class);
Expand All @@ -78,6 +81,14 @@ public String getName() {
return mName;
}

/**
* @return Currency code represented in ISO 4217 three-letter code format
*/

public String getDefaultCurrency() {
return mDefaultCurrencyCode;
}

/**
* @return set of {@code Currency} represented by this {@code Country} instance
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class TransferMethodConfigurationKeysQuery implements GqlQuery {
+ "\t\tnodes {\n"
+ "\t\t\tcode\n"
+ "\t\t\tname\n"
+ "\t\t\tdefaultCurrencyCode\n"
+ "\t\t\tcurrencies {\n"
+ "\t\t\t\tnodes {\n"
+ "\t\t\t\t\tcode\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void testBuild_withRequiredParametersOnly() {
+ "\t\tnodes {\n"
+ "\t\t\tcode\n"
+ "\t\t\tname\n"
+ "\t\t\tdefaultCurrencyCode\n"
+ "\t\t\tcurrencies {\n"
+ "\t\t\t\tnodes {\n"
+ "\t\t\t\t\tcode\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public void testPerformRequest_usingHttpPost() throws IOException {
+ "\t\tnodes {\n"
+ "\t\t\tcode\n"
+ "\t\t\tname\n"
+ "\t\t\tdefaultCurrencyCode\n"
+ "\t\t\tcurrencies {\n"
+ "\t\t\t\tnodes {\n"
+ "\t\t\t\t\tcode\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public void testToQuery_returnsQuery() {
+ "\t\tnodes {\n"
+ "\t\t\tcode\n"
+ "\t\t\tname\n"
+ "\t\t\tdefaultCurrencyCode\n"
+ "\t\t\tcurrencies {\n"
+ "\t\t\t\tnodes {\n"
+ "\t\t\t\t\tcode\n"
Expand Down