-
Notifications
You must be signed in to change notification settings - Fork 276
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
Consider adding support for Guava ImmutableSortedSet
#53
Comments
(Whoops, sorry, didn't mean to close.) |
I've thought about that, adding support for natural ordering, you nailed it down - it's a tricky with comparator. How about Sorted/Navigable map in addition?
|
Sounds great! That's exactly what we would use. |
Yes, that would be perfect. I would be fine starting out with no support for custom |
When using order annotations these collections have special support, if you want to use custom comparator, just remove annotation and build |
The current philosophy of Immutables is to intentionally keep the number of supported containers to a minimum, but it also mentions the specific set of containers could change after discussion.
In the Buck project, we depend pretty heavily on
ImmutableSortedSet
in our immutable data structures which we create from filesystem listings or glob match results. We useImmutableSortedSet
so our objects behave identically regardless of the behavior of the filesystem listing order (which is OS- and filesystem-dependent).We'd love to move these data structures to the Immutables library, but it means we have to push sorting from creation time to consumption time, which is a bit annoying (especially in tests). It'd be nice if we could do something like:
If it helps, we don't use any custom
Comparator
s; we always use natural ordering today. (I agree it might be a bit tricky to annotate theComparator
to use for aSortedSet
.)The text was updated successfully, but these errors were encountered: