Skip to content

Commit 52bc2b4

Browse files
author
Deniz Yildirim
committed
Change some more remaining Integer to Long
1 parent 700b025 commit 52bc2b4

File tree

11 files changed

+39
-39
lines changed

11 files changed

+39
-39
lines changed

src/main/java/com/bunq/sdk/context/SessionContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class SessionContext implements java.io.Serializable {
4444

4545
@Expose
4646
@SerializedName("user_id")
47-
private final Integer userId;
47+
private final Long userId;
4848

4949
@Expose
5050
@SerializedName("user_person")
@@ -129,7 +129,7 @@ Date getExpiryTime() {
129129
return expiryTime;
130130
}
131131

132-
public Integer getUserId() {
132+
public Long getUserId() {
133133
return userId;
134134
}
135135

src/main/java/com/bunq/sdk/context/UserContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void refreshContext() {
5252
this.initMainMonetaryAccount(helper);
5353
}
5454

55-
public Integer getUserId() {
55+
public Long getUserId() {
5656
return this.apiContext.getSessionContext().getUserId();
5757
}
5858

@@ -72,7 +72,7 @@ public boolean areAllUserSet() {
7272
return this.userPerson != null && this.userCompany != null && this.userApiKey != null;
7373
}
7474

75-
public Integer getMainMonetaryAccountId() {
75+
public Long getMainMonetaryAccountId() {
7676
if (this.primaryMonetaryAccountBank == null) {
7777
throw new BunqException(ERROR_PRIMARY_MONETARY_ACCOUNT_IS_NOT_SET);
7878
} else {

src/main/java/com/bunq/sdk/http/ApiClient.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class ApiClient {
6565
/**
6666
* Response code to use in case the response code is null due to unforeseen circumstances.
6767
*/
68-
private static final int DUMMY_RESPONSE_CODE = 0;
68+
private static final long DUMMY_RESPONSE_CODE = 0;
6969

7070
/**
7171
* Private variables.
@@ -272,7 +272,7 @@ private String generateSignature(BunqRequestBuilder requestBuilder) {
272272
*/
273273
private BunqResponseRaw createBunqResponseRaw(Response response)
274274
throws IOException {
275-
int responseCode = response.code();
275+
long responseCode = response.code();
276276
byte[] responseBodyBytes = Objects.requireNonNull(response.body()).bytes();
277277

278278
assertResponseSuccess(responseCode, responseBodyBytes, getResponseId(response));
@@ -293,7 +293,7 @@ private static String getResponseId(Response response) {
293293
/**
294294
*
295295
*/
296-
private static void assertResponseSuccess(Integer responseCode, byte[] responseBodyBytes, String responseId) {
296+
private static void assertResponseSuccess(Long responseCode, byte[] responseBodyBytes, String responseId) {
297297
if (responseCode == null) {
298298
responseCode = DUMMY_RESPONSE_CODE;
299299
}
@@ -307,7 +307,7 @@ private static void assertResponseSuccess(Integer responseCode, byte[] responseB
307307
*
308308
*/
309309
private static ApiException createApiExceptionRequestUnsuccessful(
310-
Integer responseCode,
310+
Long responseCode,
311311
String responseBody,
312312
String responseId
313313
) {
@@ -359,7 +359,7 @@ private static List<String> fetchAllErrorDescription(JsonObject responseBodyJson
359359
*
360360
*/
361361
private void validateResponseSignature(
362-
int responseCode,
362+
long responseCode,
363363
byte[] responseBodyBytes,
364364
Response response
365365
) {

src/main/java/com/bunq/sdk/http/Pagination.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public class Pagination {
2323
public static final String PARAM_FUTURE_ID = "future_id";
2424
public static final String PARAM_COUNT = "count";
2525

26-
private Integer olderId;
27-
private Integer newerId;
28-
private Integer futureId;
29-
private Integer count;
26+
private Long olderId;
27+
private Long newerId;
28+
private Long futureId;
29+
private Long count;
3030

3131
/**
3232
* Get the URL params required to request the next page of the listing.
@@ -47,7 +47,7 @@ private void assertHasNextPage() {
4747
}
4848
}
4949

50-
private Integer getNextId() {
50+
private Long getNextId() {
5151
if (hasNextPageAssured()) {
5252
return newerId;
5353
} else {
@@ -98,35 +98,35 @@ public Map<String, String> getUrlParamsCountOnly() {
9898
return params;
9999
}
100100

101-
public Integer getOlderId() {
101+
public Long getOlderId() {
102102
return olderId;
103103
}
104104

105-
public void setOlderId(Integer olderId) {
105+
public void setOlderId(Long olderId) {
106106
this.olderId = olderId;
107107
}
108108

109-
public Integer getNewerId() {
109+
public Long getNewerId() {
110110
return newerId;
111111
}
112112

113-
public void setNewerId(Integer newerId) {
113+
public void setNewerId(Long newerId) {
114114
this.newerId = newerId;
115115
}
116116

117-
public Integer getFutureId() {
117+
public Long getFutureId() {
118118
return futureId;
119119
}
120120

121-
public void setFutureId(Integer futureId) {
121+
public void setFutureId(Long futureId) {
122122
this.futureId = futureId;
123123
}
124124

125-
public Integer getCount() {
125+
public Long getCount() {
126126
return count;
127127
}
128128

129-
public void setCount(Integer count) {
129+
public void setCount(Long count) {
130130
this.count = count;
131131
}
132132
}

src/main/java/com/bunq/sdk/model/core/BunqModel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ protected static ApiContext getApiContext() {
195195
return BunqContext.getApiContext();
196196
}
197197

198-
protected static Integer determineUserId() {
198+
protected static Long determineUserId() {
199199
return BunqContext.getUserContext().getUserId();
200200
}
201201

202-
protected static Integer determineMonetaryAccountId(Integer id) {
202+
protected static Long determineMonetaryAccountId(Long id) {
203203
if (id == null) {
204204
return BunqContext.getUserContext().getPrimaryMonetaryAccountBank().getId();
205205
} else {

src/main/java/com/bunq/sdk/model/core/Installation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private static byte[] generateRequestBodyBytes(String publicKeyClientString) {
5959
return gson.toJson(installationRequestBody).getBytes();
6060
}
6161

62-
public Integer getId() {
62+
public Long getId() {
6363
return id.getId();
6464
}
6565

src/main/java/com/bunq/sdk/model/core/NotificationFilterUrlMonetaryAccountInternal.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static BunqResponse<List<NotificationFilterUrlObject>> createWithListResp
2828
* Create notification filters with list response type.
2929
*/
3030
public static BunqResponse<List<NotificationFilterUrlObject>> createWithListResponse(
31-
Integer monetaryAccountId,
31+
Long monetaryAccountId,
3232
List<NotificationFilterUrlObject> allNotificationFilter
3333
) {
3434
return createWithListResponse(monetaryAccountId, allNotificationFilter, null);
@@ -38,7 +38,7 @@ public static BunqResponse<List<NotificationFilterUrlObject>> createWithListResp
3838
* Create notification filters with list response type.
3939
*/
4040
public static BunqResponse<List<NotificationFilterUrlObject>> createWithListResponse(
41-
Integer monetaryAccountId,
41+
Long monetaryAccountId,
4242
List<NotificationFilterUrlObject> allNotificationFilter,
4343
Map<String, String> customHeaders
4444
) {

src/main/java/com/bunq/sdk/model/core/UserContextHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class UserContextHelper extends BunqModel {
3232
/**
3333
* The index of the first item in an array.
3434
*/
35-
private static final Integer INDEX_FIRST = 0;
35+
private static final Long INDEX_FIRST = 0;
3636

3737
/**
3838
* Status constants.
@@ -56,7 +56,7 @@ public UserApiObject getFirstUser() {
5656
return response.getValue().get(INDEX_FIRST);
5757
}
5858

59-
public MonetaryAccountBankApiObject getFirstActiveMonetaryAccountBankByUserId(Integer userId) {
59+
public MonetaryAccountBankApiObject getFirstActiveMonetaryAccountBankByUserId(Long userId) {
6060
BunqResponseRaw responseRaw = getRawResponse(
6161
String.format(ENDPOINT_MONETARY_ACCOUNT_BANK, userId)
6262
);

src/test/java/com/bunq/sdk/Config.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public static String[] getPermittedIps() {
7777
}
7878
}
7979

80-
public static Integer getUserId() {
81-
return Integer.parseInt(properties.getProperty(FIELD_USER_ID));
80+
public static Long getUserId() {
81+
return Long.parseLong(properties.getProperty(FIELD_USER_ID));
8282
}
8383

8484
public static String getContentType() {
@@ -93,12 +93,12 @@ public static String getPathAttachmentIn() {
9393
return properties.getProperty(FIELD_PATH_ATTACHMENT_IN);
9494
}
9595

96-
public static Integer getMonetaryAccountId() {
97-
return Integer.parseInt(properties.getProperty(FIELD_MONETARY_ACCOUNT_ID));
96+
public static Long getMonetaryAccountId() {
97+
return Long.parseLong(properties.getProperty(FIELD_MONETARY_ACCOUNT_ID));
9898
}
9999

100-
public static Integer getMonetaryAccountId2() {
101-
return Integer.parseInt(properties.getProperty(FIELD_MONETARY_ACCOUNT_ID2));
100+
public static Long getMonetaryAccountId2() {
101+
return Long.parseLong(properties.getProperty(FIELD_MONETARY_ACCOUNT_ID2));
102102
}
103103

104104
public static PointerObject getCounterPartyAliasOther() {
@@ -115,7 +115,7 @@ public static PointerObject getCounterPartyAliasSelf() {
115115
return new PointerObject(type, value);
116116
}
117117

118-
public static Integer getPaymentIdWithGeolocation() {
119-
return Integer.parseInt(properties.getProperty(FIELD_PAYMENT_ID_WITH_GEOLOCATION));
118+
public static Long getPaymentIdWithGeolocation() {
119+
return Long.parseLong(properties.getProperty(FIELD_PAYMENT_ID_WITH_GEOLOCATION));
120120
}
121121
}

src/test/java/com/bunq/sdk/context/Psd2ContextTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void testCreateOauthClient() {
8686
}
8787

8888
try {
89-
Integer clientId = OauthClientApiObject.create().getValue();
89+
Long clientId = OauthClientApiObject.create().getValue();
9090
OauthClientApiObject oauthClient = OauthClientApiObject.get(clientId).getValue();
9191

9292
Assert.assertNotNull(oauthClient);

0 commit comments

Comments
 (0)