Skip to content
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

Merged
merged 13 commits into from
Dec 21, 2017

Conversation

OGKevin
Copy link
Contributor

@OGKevin OGKevin commented Dec 20, 2017

Closes #51
Closes #35

@OGKevin OGKevin added this to the 0.12.4 milestone Dec 20, 2017
Copy link
Contributor Author

@OGKevin OGKevin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂️



if (model.isAllFieldNull()) {

Copy link
Contributor Author

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())) {

Copy link
Contributor Author

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) {

Copy link
Contributor Author

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.*;

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

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);

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);

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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No empty docblock?

@OGKevin
Copy link
Contributor Author

OGKevin commented Dec 21, 2017

@patrickdw1991 All yours please 👀

@OGKevin
Copy link
Contributor Author

OGKevin commented Dec 21, 2017

@andrederoos All yours

@andrederoos andrederoos merged commit 763fbf3 into develop Dec 21, 2017
@OGKevin OGKevin deleted the feature/improve-decoder_bunq/sdk_java#35 branch December 24, 2017 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants