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

(Collection) factory methods #2125

Open
danieldietrich opened this issue Oct 8, 2017 · 2 comments
Open

(Collection) factory methods #2125

danieldietrich opened this issue Oct 8, 2017 · 2 comments

Comments

@danieldietrich
Copy link
Contributor

We have too many methods called of. Because most collections are also functions, I want to simplify that.

  • of(T), of(T...)
  • ofAll(Iterable)
  • ofAll(Iterator) <-- this one might be needed because Iterator (and the upcoming TraversableOnce) will not be Iterable anymore

We need to take a look if ofXyz(Xyz) or fromXyz(Xyz) makes more sense, e.g.

  • fromEntries(j.u.Map.Entry...)
  • fromEntries(Iterable<? extends j.u.Map.Entry>)
  • etc.

Also we will have distinguished factory method names that will not build instances directly from the given method parameters (like of(T...) does for example).

  • Stream.iterate(seed, f)
  • Tree.recurse(seed, f)
  • ...
@danieldietrich
Copy link
Contributor Author

On help let's discuss it first.

@danieldietrich
Copy link
Contributor Author

We will revisit this issue for version 2.0.0 because Iterable and Iterator will have a different meaning there in the type hierarchy. More specifically, Iterator will not extend Iterable anymore!

@danieldietrich danieldietrich modified the milestones: v1.0.0, v2.0.0 Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant