Actions
Architecture #8614
closedUtility to get all objects from a sealed trait
Status:
Released
Priority:
3
Assignee:
Category:
Architecture - Dependencies
Target version:
Fix check:
Regression:
Description
We need all the time to get all objects from a sealed trait when they denote an Algebraic Data Structure (a super enum).
There is this magic macro which works on both Scala 2.10 and 2.11 and do exactly that: https://github.com/mrvisser/sealerate
Just add AT THE END of the hierachy :
def values: Set[MyTrait] = sealerate.values[MyTrait]
That's all. Values never unsynchonized ever again.
The dependency to add is:
<!-- Utility to generate all case of a sealed base class --> <dependency> <groupId>ca.mrvisser</groupId> <artifactId>sealerate_${scala-binary-version}</artifactId> <version>0.0.4</version> </dependency>
And we don't need it before 3.1 because no refactoring in 2.11 (but for ex. the new quicksearch in #8563, or password for Aix in #8593 takes advantage of it)
Actions