Skip to content

Conversation

@catacraciun
Copy link
Contributor

Why?

I am using ConversationPartCollection and it does not implement Iterator, as most of the Collections (in this SDK) do. Because of that, the code was looking pretty bad, as I couldn't use the TypedDataCollectionIterator either, as it is package-level. The solution to this is to make TypedDataCollection implement Iterator directly, and all its subclasses will benefit from it.

How?

First thing, TypedDataCollection now implements Iterator, it is delegating the hasNext(), next() and remove() methods to a TypedDataCollectionIterator instance. Second, I have removed all specific implementations of Iterator from all Collection classes, which were just copy-paste.

Catalin Craciun added 2 commits October 31, 2018 08:19
…o TypedDataCollection so that all the collections can benefit from the iterator.
@thewheat
Copy link
Contributor

Wow @catacraciun that's great and thanks for the contribution! 😄
It looks all good to me and I'll run this by the team for a full review 👍

Thanks again!

@thewheat thewheat added the java label Oct 31, 2018
Copy link
Member

@choran choran left a comment

Choose a reason for hiding this comment

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

👍 This seems really cool @catacraciun
Thanks alot for this

@choran choran merged commit 1a3bced into intercom:master Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants