@Override
  public int compareTo(Object o) {
    if (o instanceof ComparableEnum) {
      ComparableEnum other = (ComparableEnum) o;
      if (!getClassName().equals(other.getClassName())) {
        throw new ClassCastException(
            "Can not compare a " + getClassName() + " to a " + other.getClassName());
      }
      return getOrdinal() - other.getOrdinal();
    } else {
      throw new ClassCastException(
          "Can not compare an instance of " + o.getClass() + " to a " + getClass());
    }
  }
Used to represent an enum value as a PdxInstance

@since GemFire 6.6.2
geode-core/src/main/java/org/apache/geode/pdx/internal/PdxInstanceEnum.java