public EnumInfo getEnumInfoById(int enumId) {
    if (enumId == 0) {
      return null;
    }

    EnumInfo ei = idToEnum.get(enumId);
    if (ei == null) {
      ei = distributedTypeRegistry.getEnumById(enumId);
      if (ei != null) {
        idToEnum.put(enumId, ei);
        enumInfoToId.put(ei, enumId);
      }
    }
    return ei;
  }
Given an enum compute and return a code for it.
geode-core/src/main/java/org/apache/geode/pdx/internal/TypeRegistry.java