Skip to content
Open
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
16 changes: 1 addition & 15 deletions src/main/java/com/bunq/sdk/context/SessionContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,7 @@ public class SessionContext implements java.io.Serializable {
}

private int getUserId(BunqModel user) {
if (user instanceof UserPerson) {
return ((UserPerson) user).getId();
} else if (user instanceof UserCompany) {
return ((UserCompany) user).getId();
} else if (user instanceof UserApiKey) {
return ((UserApiKey) user).getId();
} else if (user instanceof UserPaymentServiceProvider) {
return ((UserPaymentServiceProvider) user).getId();
} else {
throw new BunqException(
String.format(
ERROR_UNEXPECTED_USER_TYPE, user.getClass().toString()
)
);
}
return user.getId();
}

private static Date calculateExpiryTime(SessionServer sessionServer) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/bunq/sdk/model/core/BunqModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,7 @@ protected static byte[] determineAllRequestByte(HashMap<String, Object> requestM

return requestString.replaceAll(REGEX_FIELD_FOR_REQUEST, STRING_EMPTY).getBytes();
}

abstract public Integer getId();

}