public void addRemoteEnum(int enumId, EnumInfo newInfo) {
    EnumInfo oldInfo = idToEnum.get(enumId);
    if (oldInfo == null) {
      distributedTypeRegistry.addRemoteEnum(enumId, newInfo);
      idToEnum.put(enumId, newInfo);
      enumInfoToId.put(newInfo, enumId);
    } else if (!oldInfo.equals(newInfo)) {
      Assert.fail("Old enum does not equal new enum for the same id. oldEnum=" + oldInfo
          + " new enum=" + newInfo);
    }
  }
Given an enum compute and return a code for it.
geode-core/src/main/java/org/apache/geode/pdx/internal/TypeRegistry.java