Skip to content

Conversation

jgoldhammer
Copy link
Contributor

Currently the projects api can be used to request project statistics from gitlab, but the response for the statistics is not recognized. This PR adds the information to the projects class.

@jgoldhammer
Copy link
Contributor Author

@gmessner any thoughts?

Copy link
Collaborator

@gmessner gmessner left a comment

Choose a reason for hiding this comment

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

@jgoldhammer Thanks you for the contribution. Looks great, though I would ask that you remove the toString() methods, see comments in-line.

}

@Override
public String toString() {
Copy link
Collaborator

@gmessner gmessner Jun 10, 2018

Choose a reason for hiding this comment

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

Would prefer to not override toString(), as it would be inconsistent with the other model classes. If one would like to get a String representation of the instance, you can call the following, which will return formatted JSON String:

String json = org.gitlab4j.api.utils.JacksonJson.marshal(objectInstance);

public static final boolean isValid(Project project) {
return (project != null && project.getId() != null);
}

@Override
Copy link
Collaborator

@gmessner gmessner Jun 10, 2018

Choose a reason for hiding this comment

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

Would prefer to not override toString(), as it would be inconsistent with the other model classes. If one would like to get a String representation of the instance, you can call the following, which will return formatted JSON String:

String json = org.gitlab4j.api.utils.JacksonJson.marshal(objectInstance);

Removed the toString method as suggested.
Removed toString method as suggested
@jgoldhammer
Copy link
Contributor Author

I have updated my PR. I hope, it is ok now.

Thanks
Jens

Copy link
Collaborator

@gmessner gmessner left a comment

Choose a reason for hiding this comment

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

@jgoldhammer
Thanks for the quick changes. Approving and merging. Will do a release later today after I implement another feature.

@gmessner gmessner merged commit d3788c8 into gitlab4j:master Jun 11, 2018
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.

2 participants