I am currently looking at consolidating to a single collections library in a project I'm involved in, and though I have little experience with it, I really like the look of Eclipse Collections.
One concrete use case we have is that we use a Map
implementation with soft value references in several places as a simple cache. We currently use Apache Commons Collections' ReferenceMap
for this purpose, for example:
private final Map<Integer, Long[]> cache = new ReferenceMap<>();
Of course this can be replaced by a standard Java HashMap
where the value is an SoftReference
implementation, but I was hoping Eclipse Collections had a similar "convenience" collection type or factory/builder for this purpose. Is there such a thing? Or perhaps more broadly formulated: how would I set up a Map with soft value references using Eclipse Collections and a minimum amount of boilerplate?