public static ComparisonStrategy get(Class object1Class, Class object2Class, int comparator)
        throws TypeMismatchException {
      if (isAssignableFrom(object1Class, Date.class)
          && isAssignableFrom(object1Class, Date.class)) {
        return TEMPORAL;
      } else if (object1Class != object2Class && (isAssignableFrom(object1Class, Number.class)
          && isAssignableFrom(object2Class, Number.class))) {
        return NUMERIC;
      } else if (isAssignableFrom(object1Class, Boolean.class)
          || isAssignableFrom(object2Class, Boolean.class)) {
        return BOOLEAN;
      } else if (isAssignableFrom(object1Class, Comparable.class)
          && isAssignableFrom(object2Class, Comparable.class)) {
        return COMPARABLE;
      } else if ((comparator == TOK_EQ) || (comparator == TOK_NE)) {
        return ARBITRARY;
      } else {
        throw new TypeMismatchException(
            String.format(
                "Unable to use a relational comparison operator to compare an instance of class ' %s ' with an instance of ' %s '",
                object1Class.getName(), object2Class.getName()));
      }
    }
Enum to execute comparisons based on types.
geode-core/src/main/java/org/apache/geode/cache/query/internal/types/TypeUtils.java