@@ -0,0 +1,553 @@
+package EnumValues;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A//Code from:%0A//https://virgo47.wordpress.com/2014/08/02/converting-java-enums-to-values-and-back/%0A//Modular map to get Enum Constants based on their values%0Apublic class EnumValuesMap%3CT extends EnumValues%3CY%3E, Y%3E %7B%0A%0A%09private final Map%3CY, T%3E values = new HashMap%3C%3E();%0A%0A%09public EnumValuesMap(Class%3CT%3E enumClass) %7B%0A%09%09for (T t : enumClass.getEnumConstants()) %0A%09%09%7B%0A%09%09%09values.put(t.getValue(), t);%0A%09%09%7D%0A%09%7D%0A%0A%09public T get(Y value) %7B%0A%09%09T enumValue = values.get(value);%0A%09%09return enumValue;%0A%09%7D%0A%7D%0A

Create EnumValuesMap.java