Commit 038f1dbe authored by mey's avatar mey
Browse files

EnumToAmountMap.java: save enum constants in properties object

parent ffbe792a
......@@ -30,7 +30,7 @@ public class EnumToAmountMap<K extends Enum<K>, Q extends Quantity> extends Enum
implements ProvidesInspector {
private static final long serialVersionUID = 1L;
private final K[] enumConstants;
private final Class<K> enumType;
private final Unit<Q> storeUnit;
private final Unit<Q> displayUnit;
......@@ -46,7 +46,7 @@ public class EnumToAmountMap<K extends Enum<K>, Q extends Quantity> extends Enum
public EnumToAmountMap(Class<K> enumType, Unit<Q> storeUnit, Unit<Q> displayUnit) {
super(enumType);
this.enumConstants = enumType.getEnumConstants();
this.enumType = enumType;
this.storeUnit = storeUnit;
this.displayUnit = displayUnit;
}
......@@ -108,6 +108,8 @@ public class EnumToAmountMap<K extends Enum<K>, Q extends Quantity> extends Enum
private class MyProperties extends Properties {
private static final long serialVersionUID = 1L;
private final K[] enumConstants = enumType.getEnumConstants();
@Override
public boolean isVolatile() {
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment