public static int directionToCode(Direction direction) {
    return (int)convert("direction", direction, "code");
  }
Utility class for converting different direction description types.
ql/src/java/org/apache/hadoop/hive/ql/util/DirectionUtils.java