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

Change exposed port/volumes API to use sets instead of lists #1284

Merged
merged 5 commits into from
Nov 28, 2018

Conversation

TadCordle
Copy link
Contributor

Original comment suggesting this change.

Changes API from using lists to using sets for exposed ports and volumes, since these should not contain duplicate values.

Copy link
Member

@briandealwis briandealwis left a comment

Choose a reason for hiding this comment

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

Would it be friendlier to have the method arguments be of type Collection, and have the implementations record the elements in a Set?

@chanseokoh
Copy link
Member

chanseokoh commented Nov 28, 2018

Would it be friendlier to have the method arguments be of type Collection, and have the implementations record the elements in a Set?

Hmm... it can be convenient, but I personally prefer accepting a Set. Otherwise, you have to document in the Javadocs that internally duplication will be removed, but even so, people don't usually read Javadocs for the methods that look like a simple setter.

But I don't feel strongly about ether way.

@TadCordle
Copy link
Contributor Author

Good point, it's definitely more predictable when it takes a Set instead of a Collection. I'll change it back.

@TadCordle TadCordle merged commit 7df3f7e into master Nov 28, 2018
@TadCordle TadCordle deleted the sets-instead-of-lists branch November 28, 2018 22:25
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.

5 participants