public MiniStruct deepCopy() { return new MiniStruct(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof MiniStruct) return this.equals((MiniStruct)that); return false; }
public Object getFieldValue(_Fields field) { switch (field) { case MY_STRING: return getMy_string(); case MY_ENUM: return getMy_enum(); } throw new IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public MiniStruct(MiniStruct other) { if (other.isSetMy_string()) { this.my_string = other.my_string; } if (other.isSetMy_enum()) { this.my_enum = other.my_enum; } }
public void setFieldValue(_Fields field, Object value) { switch (field) { case MY_STRING: if (value == null) { unsetMy_string(); } else { setMy_string((String)value); } break; case MY_ENUM: if (value == null) { unsetMy_enum(); } else { setMy_enum((MyEnum)value); } break; } }
public void write(org.apache.thrift.protocol.TProtocol oprot, MiniStruct struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); 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_enum != null) { if (struct.isSetMy_enum()) { oprot.writeFieldBegin(MY_ENUM_FIELD_DESC); oprot.writeI32(struct.my_enum.getValue()); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.my_string = iprot.readString(); struct.setMy_stringIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.my_enum = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32()); struct.setMy_enumIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
_val14 = new MiniStruct(); _val14.read(iprot); struct.my_enum_struct_map.put(_key13, _val14); for (int _i29 = 0; _i29 < _list27.size; ++_i29) _elem28 = new MiniStruct(); _elem28.read(iprot); _val25.add(_elem28); for (int _i35 = 0; _i35 < _list33.size; ++_i35) _elem34 = new MiniStruct(); _elem34.read(iprot); struct.my_structlist.add(_elem34); for (int _i47 = 0; _i47 < _set45.size; ++_i47) _elem46 = new MiniStruct(); _elem46.read(iprot); struct.my_structset.add(_elem46);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, MiniStruct struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.my_string = iprot.readString(); struct.setMy_stringIsSet(true); } if (incoming.get(1)) { struct.my_enum = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32()); struct.setMy_enumIsSet(true); } } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case MY_STRING: return isSetMy_string(); case MY_ENUM: return isSetMy_enum(); } throw new IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case MY_STRING: if (value == null) { unsetMy_string(); } else { setMy_string((String)value); } break; case MY_ENUM: if (value == null) { unsetMy_enum(); } else { setMy_enum((MyEnum)value); } break; } }
public void write(org.apache.thrift.protocol.TProtocol oprot, MiniStruct struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); 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_enum != null) { if (struct.isSetMy_enum()) { oprot.writeFieldBegin(MY_ENUM_FIELD_DESC); oprot.writeI32(struct.my_enum.getValue()); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.my_string = iprot.readString(); struct.setMy_stringIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.my_enum = org.apache.hadoop.hive.serde2.thrift.test.MyEnum.findByValue(iprot.readI32()); struct.setMy_enumIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
_val90 = new MiniStruct(); _val90.read(iprot); struct.my_enum_struct_map.put(_key89, _val90); for (int _i105 = 0; _i105 < _list103.size; ++_i105) _elem104 = new MiniStruct(); _elem104.read(iprot); _val101.add(_elem104); for (int _i111 = 0; _i111 < _list109.size; ++_i111) _elem110 = new MiniStruct(); _elem110.read(iprot); struct.my_structlist.add(_elem110); for (int _i123 = 0; _i123 < _set121.size; ++_i123) _elem122 = new MiniStruct(); _elem122.read(iprot); struct.my_structset.add(_elem122);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, MiniStruct struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.my_string = iprot.readString(); struct.setMy_stringIsSet(true); } if (incoming.get(1)) { struct.my_enum = MyEnum.findByValue(iprot.readI32()); struct.setMy_enumIsSet(true); } } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
public boolean equals(MiniStruct that) { if (that == null) return false; boolean this_present_my_string = true && this.isSetMy_string(); boolean that_present_my_string = true && that.isSetMy_string(); if (this_present_my_string || that_present_my_string) { if (!(this_present_my_string && that_present_my_string)) return false; if (!this.my_string.equals(that.my_string)) return false; } boolean this_present_my_enum = true && this.isSetMy_enum(); boolean that_present_my_enum = true && that.isSetMy_enum(); if (this_present_my_enum || that_present_my_enum) { if (!(this_present_my_enum && that_present_my_enum)) return false; if (!this.my_enum.equals(that.my_enum)) return false; } return true; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case MY_STRING: if (value == null) { unsetMy_string(); } else { setMy_string((String)value); } break; case MY_ENUM: if (value == null) { unsetMy_enum(); } else { setMy_enum((MyEnum)value); } break; } }
public void write(org.apache.thrift.protocol.TProtocol oprot, MiniStruct struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); 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_enum != null) { if (struct.isSetMy_enum()) { oprot.writeFieldBegin(MY_ENUM_FIELD_DESC); oprot.writeI32(struct.my_enum.getValue()); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }