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

Made JsonArray implement the List interface. #683

Closed
wants to merge 1 commit into from

Conversation

inder123
Copy link
Collaborator

@inder123 inder123 commented Aug 9, 2015

No description provided.

@inder123
Copy link
Collaborator Author

inder123 commented Aug 9, 2015

@swankjesse @JakeWharton Is this a good idea (to implement List instead of Iterable for JsonArray)? Bloats the API a little bit, but useful nonetheless.

@swankjesse
Copy link
Collaborator

It isn't a binary-compatible change.

@swankjesse
Copy link
Collaborator

Don't forget equals().

@swankjesse
Copy link
Collaborator

It don't feel strongly either way.

If we make this change we will need to figure out the binary compatibility problem.

Also if we make this change we should change JsonObject to implement Map for symmetry.

@@ -30,7 +32,7 @@
* @author Inderjeet Singh
* @author Joel Leitch
*/
public final class JsonArray extends JsonElement implements Iterable<JsonElement> {
public final class JsonArray extends JsonElement implements List<JsonElement> {
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll also want the RandomAccess marker interface.

@inder123
Copy link
Collaborator Author

I agree we should keep binary compatibility. Closing the pull request.

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