private static Object convert(String typeFrom, Object value, String typeTo) {
    Object ascObject = ASCENDING_DATA.get(typeFrom);
    Object descObject = DESCENDING_DATA.get(typeFrom);
    if (ascObject.equals(value)) {
      return ASCENDING_DATA.get(typeTo);
    } else if (descObject.equals(value)) {
      return DESCENDING_DATA.get(typeTo);
    }

    throw new IllegalArgumentException("The value " + value + " isn not a valid value for " + typeFrom);
  }
Utility class for converting different direction description types.
ql/src/java/org/apache/hadoop/hive/ql/util/DirectionUtils.java