From d77e23d56659df2662ff732b2cf97e91dad0eb78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michae=CC=88l=20van=20de=20Giessen?= Date: Mon, 18 Jun 2018 10:36:10 +0200 Subject: [PATCH] feedback, line-length, spacing (bunq/sdk_java#93) --- .../java/com/bunq/sdk/context/SessionContext.java | 1 + .../com/bunq/sdk/model/core/UserContextHelper.java | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/bunq/sdk/context/SessionContext.java b/src/main/java/com/bunq/sdk/context/SessionContext.java index fb43dee0..e704d5fd 100644 --- a/src/main/java/com/bunq/sdk/context/SessionContext.java +++ b/src/main/java/com/bunq/sdk/context/SessionContext.java @@ -102,3 +102,4 @@ public Integer getUserId() { return userId; } } + diff --git a/src/main/java/com/bunq/sdk/model/core/UserContextHelper.java b/src/main/java/com/bunq/sdk/model/core/UserContextHelper.java index 17f54845..7fd1c286 100644 --- a/src/main/java/com/bunq/sdk/model/core/UserContextHelper.java +++ b/src/main/java/com/bunq/sdk/model/core/UserContextHelper.java @@ -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; @@ -36,14 +36,15 @@ public User getFirstUser() { public MonetaryAccountBank getFirstActiveMonetaryAccountBankByUserId(Integer userId) { BunqResponseRaw responseRaw = getRawResponse(String.format(MONETARY_URL, userId)); - BunqResponse> response = fromJsonList(MonetaryAccountBank.class, responseRaw, MonetaryAccountBank.class.getSimpleName()); + String wrapper = MonetaryAccountBank.class.getSimpleName(); + BunqResponse> 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