public int getEnumId(Enum<?> v) {
    int result = 0;
    if (v != null) {
      Integer id = localEnumIds.get(v);
      if (id != null) {
        result = id;
      } else {
        result = distributedTypeRegistry.getEnumId(v);
        id = result;
        localEnumIds.put(v, id);
        EnumInfo ei = new EnumInfo(v);
        idToEnum.put(id, ei);
        enumInfoToId.put(ei, id);
      }
    }
    return result;
  }
Given an enum compute and return a code for it.
geode-core/src/main/java/org/apache/geode/pdx/internal/TypeRegistry.java