Skip to content

Commit

Permalink
feedback, line-length, spacing (bunq#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
tubbynl committed Jun 18, 2018
1 parent 3f93d18 commit 3fc4df8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/java/com/bunq/sdk/model/core/UserContextHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import java.util.List;

public class UserContextHelper extends BunqModel {
private static final String MONETARY_ACCOUNT_STATUS_ACTIVE = "ACTIVE";
private static final String ERROR_NO_ACTIVE_MONETARY_ACCOUNT_FOUND = "No active monetary account found.";
private static final String STATUS_ACTIVE = "ACTIVE";
private static final String ERROR_NO_ACTIVE_MONETARY = "No active monetary account found.";
private static final String USER_URL = "user";
private static final String MONETARY_URL = "user/%s/monetary-account-bank";
private static final Integer FIRST = 0;
Expand All @@ -36,14 +36,15 @@ public User getFirstUser() {

public MonetaryAccountBank getFirstActiveMonetaryAccountBankByUserId(Integer userId) {
BunqResponseRaw responseRaw = getRawResponse(String.format(MONETARY_URL, userId));
BunqResponse<List<MonetaryAccountBank>> response = fromJsonList(MonetaryAccountBank.class, responseRaw, MonetaryAccountBank.class.getSimpleName());
String wrapper = MonetaryAccountBank.class.getSimpleName();
BunqResponse<List<MonetaryAccountBank>> response = fromJsonList(MonetaryAccountBank.class, responseRaw, wrapper);

for(MonetaryAccountBank monetaryAccountBank:response.getValue()) {
if (MONETARY_ACCOUNT_STATUS_ACTIVE.equals(monetaryAccountBank.getStatus())) {
for (MonetaryAccountBank monetaryAccountBank:response.getValue()) {
if (STATUS_ACTIVE.equals(monetaryAccountBank.getStatus())) {
return monetaryAccountBank;
}
}
throw new BunqException(ERROR_NO_ACTIVE_MONETARY_ACCOUNT_FOUND);
throw new BunqException(ERROR_NO_ACTIVE_MONETARY);
}

@Override
Expand Down

0 comments on commit 3fc4df8

Please sign in to comment.