@Override
  public int compareTo(MegaStruct other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetMy_bool(), other.isSetMy_bool());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_bool()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_bool, other.my_bool);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_byte(), other.isSetMy_byte());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_byte()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_byte, other.my_byte);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_16bit_int(), other.isSetMy_16bit_int());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_16bit_int()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_16bit_int, other.my_16bit_int);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_32bit_int(), other.isSetMy_32bit_int());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_32bit_int()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_32bit_int, other.my_32bit_int);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_64bit_int(), other.isSetMy_64bit_int());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_64bit_int()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_64bit_int, other.my_64bit_int);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_double(), other.isSetMy_double());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_double()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_double, other.my_double);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_string(), other.isSetMy_string());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_string()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_string, other.my_string);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_binary(), other.isSetMy_binary());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_binary()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_binary, other.my_binary);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_string_string_map(), other.isSetMy_string_string_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_string_string_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_string_string_map, other.my_string_string_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_string_enum_map(), other.isSetMy_string_enum_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_string_enum_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_string_enum_map, other.my_string_enum_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_enum_string_map(), other.isSetMy_enum_string_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enum_string_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enum_string_map, other.my_enum_string_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_enum_struct_map(), other.isSetMy_enum_struct_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enum_struct_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enum_struct_map, other.my_enum_struct_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_enum_stringlist_map(), other.isSetMy_enum_stringlist_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enum_stringlist_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enum_stringlist_map, other.my_enum_stringlist_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_enum_structlist_map(), other.isSetMy_enum_structlist_map());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enum_structlist_map()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enum_structlist_map, other.my_enum_structlist_map);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_stringlist(), other.isSetMy_stringlist());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_stringlist()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_stringlist, other.my_stringlist);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_structlist(), other.isSetMy_structlist());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_structlist()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_structlist, other.my_structlist);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_enumlist(), other.isSetMy_enumlist());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enumlist()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enumlist, other.my_enumlist);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_stringset(), other.isSetMy_stringset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_stringset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_stringset, other.my_stringset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_enumset(), other.isSetMy_enumset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_enumset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_enumset, other.my_enumset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMy_structset(), other.isSetMy_structset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMy_structset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.my_structset, other.my_structset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise
serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/MegaStruct.java