-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add constructor with request field bunq/sdk_java#50 #95
Changes from 3 commits
53dd0e0
80bea43
c22775e
328b9b3
ffc61c4
52d1fad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
import com.google.gson.stream.JsonReader; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
|
||
abstract public class BunqModel { | ||
|
@@ -30,6 +31,16 @@ abstract public class BunqModel { | |
*/ | ||
private static final int INDEX_FIRST = 0; | ||
|
||
/** | ||
* String format consents. | ||
*/ | ||
private static final String STRING_EMPTY = ""; | ||
|
||
/** | ||
* Regex constatns. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Constants |
||
*/ | ||
private static final String REGEX_FIELD_FOR_REQUEST = "(_field_for_request)"; | ||
|
||
/** | ||
* Gson builder for serialization. | ||
*/ | ||
|
@@ -179,4 +190,11 @@ protected static Integer determineMonetaryAccountId(Integer id) { | |
return id; | ||
} | ||
} | ||
|
||
protected static byte[] determineRequestByte(HashMap<String, Object> requestMap) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not just one byte right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fair enough. |
||
String requestString = gson.toJson(requestMap).toString(); | ||
|
||
return requestString.replaceAll(REGEX_FIELD_FOR_REQUEST, STRING_EMPTY).getBytes(); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it should say contents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constants xD :D