-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feature/improve decoder bunq/sdk java#35 #52
Feature/improve decoder bunq/sdk java#35 #52
Conversation
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.
🤦♂️
|
||
|
||
if (model.isAllFieldNull()) { | ||
|
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.
Remove line
for(Field field : allFields) { | ||
|
||
if (!BunqModel.class.isAssignableFrom(field.getType())) { | ||
|
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.
Bruv ?
Field[] allFields = model.getClass().getDeclaredFields(); | ||
|
||
for(Field field : allFields) { | ||
|
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.
This line can also go as well
import com.bunq.sdk.exception.BunqException; | ||
import com.bunq.sdk.model.core.AnchorObjectInterface; | ||
import com.bunq.sdk.model.core.BunqModel; | ||
import com.google.gson.*; |
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.
Wildcard in import :'(
|
||
public class AnchorObjectAdapter implements JsonDeserializer<AnchorObjectInterface> { | ||
@Override | ||
public AnchorObjectInterface deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws |
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.
Moving throws to next line makes it nicer readable
public AnchorObjectInterface deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws | ||
JsonParseException { | ||
AnchorObjectInterface model = new Gson().fromJson(json, typeOfT); | ||
|
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.
2 newlines
} catch (IllegalAccessException e) { | ||
throw new BunqException(e.getMessage()); | ||
} | ||
field.setAccessible(false); |
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.
Add new line before this :)
@@ -34,6 +35,13 @@ | |||
protected BunqModel() { | |||
} | |||
|
|||
public static <T> T fromJsonReader(Class<T> tClass, JsonReader reader) { |
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.
No empty docblock?
@patrickdw1991 All yours please 👀 |
@andrederoos All yours |
Closes #51
Closes #35