0001
0002
0003
0004
0005
0006
0007 package org.apache.hive.service.cli.thrift;
0008
0009 import org.apache.commons.lang.builder.HashCodeBuilder;
0010 import org.apache.thrift.scheme.IScheme;
0011 import org.apache.thrift.scheme.SchemeFactory;
0012 import org.apache.thrift.scheme.StandardScheme;
0013
0014 import org.apache.thrift.scheme.TupleScheme;
0015 import org.apache.thrift.protocol.TTupleProtocol;
0016 import org.apache.thrift.protocol.TProtocolException;
0017 import org.apache.thrift.EncodingUtils;
0018 import org.apache.thrift.TException;
0019 import java.util.List;
0020 import java.util.ArrayList;
0021 import java.util.Map;
0022 import java.util.HashMap;
0023 import java.util.EnumMap;
0024 import java.util.Set;
0025 import java.util.HashSet;
0026 import java.util.EnumSet;
0027 import java.util.Collections;
0028 import java.util.BitSet;
0029 import java.nio.ByteBuffer;
0030 import java.util.Arrays;
0031 import org.slf4j.Logger;
0032 import org.slf4j.LoggerFactory;
0033
0034 public class TTypeEntry extends org.apache.thrift.TUnion<TTypeEntry, TTypeEntry._Fields> {
0035 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeEntry");
0036 private static final org.apache.thrift.protocol.TField PRIMITIVE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("primitiveEntry", org.apache.thrift.protocol.TType.STRUCT, (short)1);
0037 private static final org.apache.thrift.protocol.TField ARRAY_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("arrayEntry", org.apache.thrift.protocol.TType.STRUCT, (short)2);
0038 private static final org.apache.thrift.protocol.TField MAP_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("mapEntry", org.apache.thrift.protocol.TType.STRUCT, (short)3);
0039 private static final org.apache.thrift.protocol.TField STRUCT_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("structEntry", org.apache.thrift.protocol.TType.STRUCT, (short)4);
0040 private static final org.apache.thrift.protocol.TField UNION_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("unionEntry", org.apache.thrift.protocol.TType.STRUCT, (short)5);
0041 private static final org.apache.thrift.protocol.TField USER_DEFINED_TYPE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("userDefinedTypeEntry", org.apache.thrift.protocol.TType.STRUCT, (short)6);
0042
0043
0044 public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0045 PRIMITIVE_ENTRY((short)1, "primitiveEntry"),
0046 ARRAY_ENTRY((short)2, "arrayEntry"),
0047 MAP_ENTRY((short)3, "mapEntry"),
0048 STRUCT_ENTRY((short)4, "structEntry"),
0049 UNION_ENTRY((short)5, "unionEntry"),
0050 USER_DEFINED_TYPE_ENTRY((short)6, "userDefinedTypeEntry");
0051
0052 private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0053
0054 static {
0055 for (_Fields field : EnumSet.allOf(_Fields.class)) {
0056 byName.put(field.getFieldName(), field);
0057 }
0058 }
0059
0060
0061
0062
0063 public static _Fields findByThriftId(int fieldId) {
0064 switch(fieldId) {
0065 case 1:
0066 return PRIMITIVE_ENTRY;
0067 case 2:
0068 return ARRAY_ENTRY;
0069 case 3:
0070 return MAP_ENTRY;
0071 case 4:
0072 return STRUCT_ENTRY;
0073 case 5:
0074 return UNION_ENTRY;
0075 case 6:
0076 return USER_DEFINED_TYPE_ENTRY;
0077 default:
0078 return null;
0079 }
0080 }
0081
0082
0083
0084
0085
0086 public static _Fields findByThriftIdOrThrow(int fieldId) {
0087 _Fields fields = findByThriftId(fieldId);
0088 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0089 return fields;
0090 }
0091
0092
0093
0094
0095 public static _Fields findByName(String name) {
0096 return byName.get(name);
0097 }
0098
0099 private final short _thriftId;
0100 private final String _fieldName;
0101
0102 _Fields(short thriftId, String fieldName) {
0103 _thriftId = thriftId;
0104 _fieldName = fieldName;
0105 }
0106
0107 public short getThriftFieldId() {
0108 return _thriftId;
0109 }
0110
0111 public String getFieldName() {
0112 return _fieldName;
0113 }
0114 }
0115
0116 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0117 static {
0118 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0119 tmpMap.put(_Fields.PRIMITIVE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("primitiveEntry", org.apache.thrift.TFieldRequirementType.DEFAULT,
0120 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPrimitiveTypeEntry.class)));
0121 tmpMap.put(_Fields.ARRAY_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("arrayEntry", org.apache.thrift.TFieldRequirementType.DEFAULT,
0122 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TArrayTypeEntry.class)));
0123 tmpMap.put(_Fields.MAP_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("mapEntry", org.apache.thrift.TFieldRequirementType.DEFAULT,
0124 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TMapTypeEntry.class)));
0125 tmpMap.put(_Fields.STRUCT_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("structEntry", org.apache.thrift.TFieldRequirementType.DEFAULT,
0126 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStructTypeEntry.class)));
0127 tmpMap.put(_Fields.UNION_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("unionEntry", org.apache.thrift.TFieldRequirementType.DEFAULT,
0128 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUnionTypeEntry.class)));
0129 tmpMap.put(_Fields.USER_DEFINED_TYPE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("userDefinedTypeEntry", org.apache.thrift.TFieldRequirementType.DEFAULT,
0130 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUserDefinedTypeEntry.class)));
0131 metaDataMap = Collections.unmodifiableMap(tmpMap);
0132 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeEntry.class, metaDataMap);
0133 }
0134
0135 public TTypeEntry() {
0136 super();
0137 }
0138
0139 public TTypeEntry(TTypeEntry._Fields setField, Object value) {
0140 super(setField, value);
0141 }
0142
0143 public TTypeEntry(TTypeEntry other) {
0144 super(other);
0145 }
0146 public TTypeEntry deepCopy() {
0147 return new TTypeEntry(this);
0148 }
0149
0150 public static TTypeEntry primitiveEntry(TPrimitiveTypeEntry value) {
0151 TTypeEntry x = new TTypeEntry();
0152 x.setPrimitiveEntry(value);
0153 return x;
0154 }
0155
0156 public static TTypeEntry arrayEntry(TArrayTypeEntry value) {
0157 TTypeEntry x = new TTypeEntry();
0158 x.setArrayEntry(value);
0159 return x;
0160 }
0161
0162 public static TTypeEntry mapEntry(TMapTypeEntry value) {
0163 TTypeEntry x = new TTypeEntry();
0164 x.setMapEntry(value);
0165 return x;
0166 }
0167
0168 public static TTypeEntry structEntry(TStructTypeEntry value) {
0169 TTypeEntry x = new TTypeEntry();
0170 x.setStructEntry(value);
0171 return x;
0172 }
0173
0174 public static TTypeEntry unionEntry(TUnionTypeEntry value) {
0175 TTypeEntry x = new TTypeEntry();
0176 x.setUnionEntry(value);
0177 return x;
0178 }
0179
0180 public static TTypeEntry userDefinedTypeEntry(TUserDefinedTypeEntry value) {
0181 TTypeEntry x = new TTypeEntry();
0182 x.setUserDefinedTypeEntry(value);
0183 return x;
0184 }
0185
0186
0187 @Override
0188 protected void checkType(_Fields setField, Object value) throws ClassCastException {
0189 switch (setField) {
0190 case PRIMITIVE_ENTRY:
0191 if (value instanceof TPrimitiveTypeEntry) {
0192 break;
0193 }
0194 throw new ClassCastException("Was expecting value of type TPrimitiveTypeEntry for field 'primitiveEntry', but got " + value.getClass().getSimpleName());
0195 case ARRAY_ENTRY:
0196 if (value instanceof TArrayTypeEntry) {
0197 break;
0198 }
0199 throw new ClassCastException("Was expecting value of type TArrayTypeEntry for field 'arrayEntry', but got " + value.getClass().getSimpleName());
0200 case MAP_ENTRY:
0201 if (value instanceof TMapTypeEntry) {
0202 break;
0203 }
0204 throw new ClassCastException("Was expecting value of type TMapTypeEntry for field 'mapEntry', but got " + value.getClass().getSimpleName());
0205 case STRUCT_ENTRY:
0206 if (value instanceof TStructTypeEntry) {
0207 break;
0208 }
0209 throw new ClassCastException("Was expecting value of type TStructTypeEntry for field 'structEntry', but got " + value.getClass().getSimpleName());
0210 case UNION_ENTRY:
0211 if (value instanceof TUnionTypeEntry) {
0212 break;
0213 }
0214 throw new ClassCastException("Was expecting value of type TUnionTypeEntry for field 'unionEntry', but got " + value.getClass().getSimpleName());
0215 case USER_DEFINED_TYPE_ENTRY:
0216 if (value instanceof TUserDefinedTypeEntry) {
0217 break;
0218 }
0219 throw new ClassCastException("Was expecting value of type TUserDefinedTypeEntry for field 'userDefinedTypeEntry', but got " + value.getClass().getSimpleName());
0220 default:
0221 throw new IllegalArgumentException("Unknown field id " + setField);
0222 }
0223 }
0224
0225 @Override
0226 protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
0227 _Fields setField = _Fields.findByThriftId(field.id);
0228 if (setField != null) {
0229 switch (setField) {
0230 case PRIMITIVE_ENTRY:
0231 if (field.type == PRIMITIVE_ENTRY_FIELD_DESC.type) {
0232 TPrimitiveTypeEntry primitiveEntry;
0233 primitiveEntry = new TPrimitiveTypeEntry();
0234 primitiveEntry.read(iprot);
0235 return primitiveEntry;
0236 } else {
0237 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
0238 return null;
0239 }
0240 case ARRAY_ENTRY:
0241 if (field.type == ARRAY_ENTRY_FIELD_DESC.type) {
0242 TArrayTypeEntry arrayEntry;
0243 arrayEntry = new TArrayTypeEntry();
0244 arrayEntry.read(iprot);
0245 return arrayEntry;
0246 } else {
0247 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
0248 return null;
0249 }
0250 case MAP_ENTRY:
0251 if (field.type == MAP_ENTRY_FIELD_DESC.type) {
0252 TMapTypeEntry mapEntry;
0253 mapEntry = new TMapTypeEntry();
0254 mapEntry.read(iprot);
0255 return mapEntry;
0256 } else {
0257 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
0258 return null;
0259 }
0260 case STRUCT_ENTRY:
0261 if (field.type == STRUCT_ENTRY_FIELD_DESC.type) {
0262 TStructTypeEntry structEntry;
0263 structEntry = new TStructTypeEntry();
0264 structEntry.read(iprot);
0265 return structEntry;
0266 } else {
0267 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
0268 return null;
0269 }
0270 case UNION_ENTRY:
0271 if (field.type == UNION_ENTRY_FIELD_DESC.type) {
0272 TUnionTypeEntry unionEntry;
0273 unionEntry = new TUnionTypeEntry();
0274 unionEntry.read(iprot);
0275 return unionEntry;
0276 } else {
0277 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
0278 return null;
0279 }
0280 case USER_DEFINED_TYPE_ENTRY:
0281 if (field.type == USER_DEFINED_TYPE_ENTRY_FIELD_DESC.type) {
0282 TUserDefinedTypeEntry userDefinedTypeEntry;
0283 userDefinedTypeEntry = new TUserDefinedTypeEntry();
0284 userDefinedTypeEntry.read(iprot);
0285 return userDefinedTypeEntry;
0286 } else {
0287 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
0288 return null;
0289 }
0290 default:
0291 throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
0292 }
0293 } else {
0294 return null;
0295 }
0296 }
0297
0298 @Override
0299 protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0300 switch (setField_) {
0301 case PRIMITIVE_ENTRY:
0302 TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_;
0303 primitiveEntry.write(oprot);
0304 return;
0305 case ARRAY_ENTRY:
0306 TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_;
0307 arrayEntry.write(oprot);
0308 return;
0309 case MAP_ENTRY:
0310 TMapTypeEntry mapEntry = (TMapTypeEntry)value_;
0311 mapEntry.write(oprot);
0312 return;
0313 case STRUCT_ENTRY:
0314 TStructTypeEntry structEntry = (TStructTypeEntry)value_;
0315 structEntry.write(oprot);
0316 return;
0317 case UNION_ENTRY:
0318 TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_;
0319 unionEntry.write(oprot);
0320 return;
0321 case USER_DEFINED_TYPE_ENTRY:
0322 TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_;
0323 userDefinedTypeEntry.write(oprot);
0324 return;
0325 default:
0326 throw new IllegalStateException("Cannot write union with unknown field " + setField_);
0327 }
0328 }
0329
0330 @Override
0331 protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
0332 _Fields setField = _Fields.findByThriftId(fieldID);
0333 if (setField != null) {
0334 switch (setField) {
0335 case PRIMITIVE_ENTRY:
0336 TPrimitiveTypeEntry primitiveEntry;
0337 primitiveEntry = new TPrimitiveTypeEntry();
0338 primitiveEntry.read(iprot);
0339 return primitiveEntry;
0340 case ARRAY_ENTRY:
0341 TArrayTypeEntry arrayEntry;
0342 arrayEntry = new TArrayTypeEntry();
0343 arrayEntry.read(iprot);
0344 return arrayEntry;
0345 case MAP_ENTRY:
0346 TMapTypeEntry mapEntry;
0347 mapEntry = new TMapTypeEntry();
0348 mapEntry.read(iprot);
0349 return mapEntry;
0350 case STRUCT_ENTRY:
0351 TStructTypeEntry structEntry;
0352 structEntry = new TStructTypeEntry();
0353 structEntry.read(iprot);
0354 return structEntry;
0355 case UNION_ENTRY:
0356 TUnionTypeEntry unionEntry;
0357 unionEntry = new TUnionTypeEntry();
0358 unionEntry.read(iprot);
0359 return unionEntry;
0360 case USER_DEFINED_TYPE_ENTRY:
0361 TUserDefinedTypeEntry userDefinedTypeEntry;
0362 userDefinedTypeEntry = new TUserDefinedTypeEntry();
0363 userDefinedTypeEntry.read(iprot);
0364 return userDefinedTypeEntry;
0365 default:
0366 throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
0367 }
0368 } else {
0369 throw new TProtocolException("Couldn't find a field with field id " + fieldID);
0370 }
0371 }
0372
0373 @Override
0374 protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0375 switch (setField_) {
0376 case PRIMITIVE_ENTRY:
0377 TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_;
0378 primitiveEntry.write(oprot);
0379 return;
0380 case ARRAY_ENTRY:
0381 TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_;
0382 arrayEntry.write(oprot);
0383 return;
0384 case MAP_ENTRY:
0385 TMapTypeEntry mapEntry = (TMapTypeEntry)value_;
0386 mapEntry.write(oprot);
0387 return;
0388 case STRUCT_ENTRY:
0389 TStructTypeEntry structEntry = (TStructTypeEntry)value_;
0390 structEntry.write(oprot);
0391 return;
0392 case UNION_ENTRY:
0393 TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_;
0394 unionEntry.write(oprot);
0395 return;
0396 case USER_DEFINED_TYPE_ENTRY:
0397 TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_;
0398 userDefinedTypeEntry.write(oprot);
0399 return;
0400 default:
0401 throw new IllegalStateException("Cannot write union with unknown field " + setField_);
0402 }
0403 }
0404
0405 @Override
0406 protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {
0407 switch (setField) {
0408 case PRIMITIVE_ENTRY:
0409 return PRIMITIVE_ENTRY_FIELD_DESC;
0410 case ARRAY_ENTRY:
0411 return ARRAY_ENTRY_FIELD_DESC;
0412 case MAP_ENTRY:
0413 return MAP_ENTRY_FIELD_DESC;
0414 case STRUCT_ENTRY:
0415 return STRUCT_ENTRY_FIELD_DESC;
0416 case UNION_ENTRY:
0417 return UNION_ENTRY_FIELD_DESC;
0418 case USER_DEFINED_TYPE_ENTRY:
0419 return USER_DEFINED_TYPE_ENTRY_FIELD_DESC;
0420 default:
0421 throw new IllegalArgumentException("Unknown field id " + setField);
0422 }
0423 }
0424
0425 @Override
0426 protected org.apache.thrift.protocol.TStruct getStructDesc() {
0427 return STRUCT_DESC;
0428 }
0429
0430 @Override
0431 protected _Fields enumForId(short id) {
0432 return _Fields.findByThriftIdOrThrow(id);
0433 }
0434
0435 public _Fields fieldForId(int fieldId) {
0436 return _Fields.findByThriftId(fieldId);
0437 }
0438
0439
0440 public TPrimitiveTypeEntry getPrimitiveEntry() {
0441 if (getSetField() == _Fields.PRIMITIVE_ENTRY) {
0442 return (TPrimitiveTypeEntry)getFieldValue();
0443 } else {
0444 throw new RuntimeException("Cannot get field 'primitiveEntry' because union is currently set to " + getFieldDesc(getSetField()).name);
0445 }
0446 }
0447
0448 public void setPrimitiveEntry(TPrimitiveTypeEntry value) {
0449 if (value == null) throw new NullPointerException();
0450 setField_ = _Fields.PRIMITIVE_ENTRY;
0451 value_ = value;
0452 }
0453
0454 public TArrayTypeEntry getArrayEntry() {
0455 if (getSetField() == _Fields.ARRAY_ENTRY) {
0456 return (TArrayTypeEntry)getFieldValue();
0457 } else {
0458 throw new RuntimeException("Cannot get field 'arrayEntry' because union is currently set to " + getFieldDesc(getSetField()).name);
0459 }
0460 }
0461
0462 public void setArrayEntry(TArrayTypeEntry value) {
0463 if (value == null) throw new NullPointerException();
0464 setField_ = _Fields.ARRAY_ENTRY;
0465 value_ = value;
0466 }
0467
0468 public TMapTypeEntry getMapEntry() {
0469 if (getSetField() == _Fields.MAP_ENTRY) {
0470 return (TMapTypeEntry)getFieldValue();
0471 } else {
0472 throw new RuntimeException("Cannot get field 'mapEntry' because union is currently set to " + getFieldDesc(getSetField()).name);
0473 }
0474 }
0475
0476 public void setMapEntry(TMapTypeEntry value) {
0477 if (value == null) throw new NullPointerException();
0478 setField_ = _Fields.MAP_ENTRY;
0479 value_ = value;
0480 }
0481
0482 public TStructTypeEntry getStructEntry() {
0483 if (getSetField() == _Fields.STRUCT_ENTRY) {
0484 return (TStructTypeEntry)getFieldValue();
0485 } else {
0486 throw new RuntimeException("Cannot get field 'structEntry' because union is currently set to " + getFieldDesc(getSetField()).name);
0487 }
0488 }
0489
0490 public void setStructEntry(TStructTypeEntry value) {
0491 if (value == null) throw new NullPointerException();
0492 setField_ = _Fields.STRUCT_ENTRY;
0493 value_ = value;
0494 }
0495
0496 public TUnionTypeEntry getUnionEntry() {
0497 if (getSetField() == _Fields.UNION_ENTRY) {
0498 return (TUnionTypeEntry)getFieldValue();
0499 } else {
0500 throw new RuntimeException("Cannot get field 'unionEntry' because union is currently set to " + getFieldDesc(getSetField()).name);
0501 }
0502 }
0503
0504 public void setUnionEntry(TUnionTypeEntry value) {
0505 if (value == null) throw new NullPointerException();
0506 setField_ = _Fields.UNION_ENTRY;
0507 value_ = value;
0508 }
0509
0510 public TUserDefinedTypeEntry getUserDefinedTypeEntry() {
0511 if (getSetField() == _Fields.USER_DEFINED_TYPE_ENTRY) {
0512 return (TUserDefinedTypeEntry)getFieldValue();
0513 } else {
0514 throw new RuntimeException("Cannot get field 'userDefinedTypeEntry' because union is currently set to " + getFieldDesc(getSetField()).name);
0515 }
0516 }
0517
0518 public void setUserDefinedTypeEntry(TUserDefinedTypeEntry value) {
0519 if (value == null) throw new NullPointerException();
0520 setField_ = _Fields.USER_DEFINED_TYPE_ENTRY;
0521 value_ = value;
0522 }
0523
0524 public boolean isSetPrimitiveEntry() {
0525 return setField_ == _Fields.PRIMITIVE_ENTRY;
0526 }
0527
0528
0529 public boolean isSetArrayEntry() {
0530 return setField_ == _Fields.ARRAY_ENTRY;
0531 }
0532
0533
0534 public boolean isSetMapEntry() {
0535 return setField_ == _Fields.MAP_ENTRY;
0536 }
0537
0538
0539 public boolean isSetStructEntry() {
0540 return setField_ == _Fields.STRUCT_ENTRY;
0541 }
0542
0543
0544 public boolean isSetUnionEntry() {
0545 return setField_ == _Fields.UNION_ENTRY;
0546 }
0547
0548
0549 public boolean isSetUserDefinedTypeEntry() {
0550 return setField_ == _Fields.USER_DEFINED_TYPE_ENTRY;
0551 }
0552
0553
0554 public boolean equals(Object other) {
0555 if (other instanceof TTypeEntry) {
0556 return equals((TTypeEntry)other);
0557 } else {
0558 return false;
0559 }
0560 }
0561
0562 public boolean equals(TTypeEntry other) {
0563 return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue());
0564 }
0565
0566 @Override
0567 public int compareTo(TTypeEntry other) {
0568 int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField());
0569 if (lastComparison == 0) {
0570 return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue());
0571 }
0572 return lastComparison;
0573 }
0574
0575
0576 @Override
0577 public int hashCode() {
0578 HashCodeBuilder hcb = new HashCodeBuilder();
0579 hcb.append(this.getClass().getName());
0580 org.apache.thrift.TFieldIdEnum setField = getSetField();
0581 if (setField != null) {
0582 hcb.append(setField.getThriftFieldId());
0583 Object value = getFieldValue();
0584 if (value instanceof org.apache.thrift.TEnum) {
0585 hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue());
0586 } else {
0587 hcb.append(value);
0588 }
0589 }
0590 return hcb.toHashCode();
0591 }
0592 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0593 try {
0594 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0595 } catch (org.apache.thrift.TException te) {
0596 throw new java.io.IOException(te);
0597 }
0598 }
0599
0600
0601 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0602 try {
0603 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0604 } catch (org.apache.thrift.TException te) {
0605 throw new java.io.IOException(te);
0606 }
0607 }
0608
0609
0610 }