/**
* Values are not synchronized. Needs a manual call to refreshFromEnum.
*/
public static Type enumAsType(Enumeration en)
{
TypeInfo typeInfo = new TypeInfo(en.name());
Set<Value> values = SetFactory.createSet(Value.class);
for (Literal lit : en.literals()) {
values.add(new Value(lit.toString()));
}
return new Type(typeInfo, true, values);