Is there a one-liner to convert a list of String to a set of enum? For instance, having:
public enum MyVal {
ONE, TWO, THREE
}
and
List<String> myValues = Arrays.asList("ONE", "TWO", "TWO");
I'd like to convert myValues
to a Set<MyVal>
containing the same items as:
EnumSet.of(MyVal.ONE, MyVal.TWO)