public abstract class EnumConvertor<Abstracted extends Enum,Concrete extends Enum>
Maps an enum class to another enum class. By default, the converter uses a heuristic
to convert the enums. The general convention is usually that enums are named the same, except
in one off cases. If the enum isn't mapped 1:1, then the converter will need to provide the
conversion information by overriding the get(Abstracted|Concrete)EnumCustom methods, which
contain a switch (or similar) statement that does the proper conversion. Usually both
or neither methods will need overriding. There is a runtime unit test, which checks
the enums for missing values at runtime, and reports any values that can't be converted, allowing
for easier and faster identification of failure conditions. This is not an ideal model, but
does allow for enums themselves to be abstracted away from a particular platform.
Given a concrete Enum, returns the abstract version. This is generally
called in platform specific code. The platform is given a platform specific
enum, and it needs to return control to the abstract code, so it calls
which in turn abstractly handles the conversion from platform to abstract enum.
Given an abstract Enum, returns the concrete version. This is generally
called in platform specific code. The platform is given an abstract
enum, and it needs to convert to the platform specific enum, so it calls
which in turn abstractly handles the conversion from abstract to platform enum.
abstracted - The abstract, platform independent enum