commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <>
Subject [Collections] UnmodifiableSet/UnmodifiableList
Date Thu, 23 Mar 2017 07:48:11 GMT

I see that the Collections4 provides those classes. Anyway I wonder
why I the constructor is private and why the factory method
unmodifiableSet() returns Set?

I would love to use those classes directly, to be straightforward that
I expect the UnmodifiableSet and not just a Set.

What about adding a method like in Guava? Something like this:

public static UnmodifiableSet of(Set<T> set)

This allows define UnmodifiableSets in code and use compiler to check
if everything is ok.

+ 48 606 323 122

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message