public void write(org.apache.thrift.protocol.TProtocol oprot, MegaStruct struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetMy_bool()) {
        oprot.writeFieldBegin(MY_BOOL_FIELD_DESC);
        oprot.writeBool(struct.my_bool);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMy_byte()) {
        oprot.writeFieldBegin(MY_BYTE_FIELD_DESC);
        oprot.writeByte(struct.my_byte);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMy_16bit_int()) {
        oprot.writeFieldBegin(MY_16BIT_INT_FIELD_DESC);
        oprot.writeI16(struct.my_16bit_int);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMy_32bit_int()) {
        oprot.writeFieldBegin(MY_32BIT_INT_FIELD_DESC);
        oprot.writeI32(struct.my_32bit_int);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMy_64bit_int()) {
        oprot.writeFieldBegin(MY_64BIT_INT_FIELD_DESC);
        oprot.writeI64(struct.my_64bit_int);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMy_double()) {
        oprot.writeFieldBegin(MY_DOUBLE_FIELD_DESC);
        oprot.writeDouble(struct.my_double);
        oprot.writeFieldEnd();
      }
      if (struct.my_string != null) {
        if (struct.isSetMy_string()) {
          oprot.writeFieldBegin(MY_STRING_FIELD_DESC);
          oprot.writeString(struct.my_string);
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_binary != null) {
        if (struct.isSetMy_binary()) {
          oprot.writeFieldBegin(MY_BINARY_FIELD_DESC);
          oprot.writeBinary(struct.my_binary);
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_string_string_map != null) {
        if (struct.isSetMy_string_string_map()) {
          oprot.writeFieldBegin(MY_STRING_STRING_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.my_string_string_map.size()));
            for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter48 : struct.my_string_string_map.entrySet())
            {
              oprot.writeString(_iter48.getKey());
              oprot.writeString(_iter48.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_string_enum_map != null) {
        if (struct.isSetMy_string_enum_map()) {
          oprot.writeFieldBegin(MY_STRING_ENUM_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.my_string_enum_map.size()));
            for (java.util.Map.Entry<java.lang.String, MyEnum> _iter49 : struct.my_string_enum_map.entrySet())
            {
              oprot.writeString(_iter49.getKey());
              oprot.writeI32(_iter49.getValue().getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enum_string_map != null) {
        if (struct.isSetMy_enum_string_map()) {
          oprot.writeFieldBegin(MY_ENUM_STRING_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, struct.my_enum_string_map.size()));
            for (java.util.Map.Entry<MyEnum, java.lang.String> _iter50 : struct.my_enum_string_map.entrySet())
            {
              oprot.writeI32(_iter50.getKey().getValue());
              oprot.writeString(_iter50.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enum_struct_map != null) {
        if (struct.isSetMy_enum_struct_map()) {
          oprot.writeFieldBegin(MY_ENUM_STRUCT_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.my_enum_struct_map.size()));
            for (java.util.Map.Entry<MyEnum, MiniStruct> _iter51 : struct.my_enum_struct_map.entrySet())
            {
              oprot.writeI32(_iter51.getKey().getValue());
              _iter51.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enum_stringlist_map != null) {
        if (struct.isSetMy_enum_stringlist_map()) {
          oprot.writeFieldBegin(MY_ENUM_STRINGLIST_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.LIST, struct.my_enum_stringlist_map.size()));
            for (java.util.Map.Entry<MyEnum, java.util.List<java.lang.String>> _iter52 : struct.my_enum_stringlist_map.entrySet())
            {
              oprot.writeI32(_iter52.getKey().getValue());
              {
                oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter52.getValue().size()));
                for (java.lang.String _iter53 : _iter52.getValue())
                {
                  oprot.writeString(_iter53);
                }
                oprot.writeListEnd();
              }
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enum_structlist_map != null) {
        if (struct.isSetMy_enum_structlist_map()) {
          oprot.writeFieldBegin(MY_ENUM_STRUCTLIST_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.LIST, struct.my_enum_structlist_map.size()));
            for (java.util.Map.Entry<MyEnum, java.util.List<MiniStruct>> _iter54 : struct.my_enum_structlist_map.entrySet())
            {
              oprot.writeI32(_iter54.getKey().getValue());
              {
                oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter54.getValue().size()));
                for (MiniStruct _iter55 : _iter54.getValue())
                {
                  _iter55.write(oprot);
                }
                oprot.writeListEnd();
              }
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_stringlist != null) {
        if (struct.isSetMy_stringlist()) {
          oprot.writeFieldBegin(MY_STRINGLIST_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.my_stringlist.size()));
            for (java.lang.String _iter56 : struct.my_stringlist)
            {
              oprot.writeString(_iter56);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_structlist != null) {
        if (struct.isSetMy_structlist()) {
          oprot.writeFieldBegin(MY_STRUCTLIST_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.my_structlist.size()));
            for (MiniStruct _iter57 : struct.my_structlist)
            {
              _iter57.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enumlist != null) {
        if (struct.isSetMy_enumlist()) {
          oprot.writeFieldBegin(MY_ENUMLIST_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.my_enumlist.size()));
            for (MyEnum _iter58 : struct.my_enumlist)
            {
              oprot.writeI32(_iter58.getValue());
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_stringset != null) {
        if (struct.isSetMy_stringset()) {
          oprot.writeFieldBegin(MY_STRINGSET_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.my_stringset.size()));
            for (java.lang.String _iter59 : struct.my_stringset)
            {
              oprot.writeString(_iter59);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_enumset != null) {
        if (struct.isSetMy_enumset()) {
          oprot.writeFieldBegin(MY_ENUMSET_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.my_enumset.size()));
            for (MyEnum _iter60 : struct.my_enumset)
            {
              oprot.writeI32(_iter60.getValue());
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.my_structset != null) {
        if (struct.isSetMy_structset()) {
          oprot.writeFieldBegin(MY_STRUCTSET_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.my_structset.size()));
            for (MiniStruct _iter61 : struct.my_structset)
            {
              _iter61.write(oprot);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
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