Elegant way to deserialise EnumSet from String
With Java 8 you can do something like this with Lambda expressions and streams:
EnumSet.copyOf(Arrays.asList(str.split(","))
.stream().map(FooType::valueOf).collect(Collectors.toList()))
With Java 8 you can do something like this with Lambda expressions and streams:
EnumSet.copyOf(Arrays.asList(str.split(","))
.stream().map(FooType::valueOf).collect(Collectors.toList()))