Back to home page

OSCL-LXR

 
 

    


0001 /**
0002  * Autogenerated by Thrift Compiler (0.9.3)
0003  *
0004  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
0005  *  @generated
0006  */
0007 package org.apache.hive.service.rpc.thrift;
0008 
0009 import org.apache.thrift.scheme.IScheme;
0010 import org.apache.thrift.scheme.SchemeFactory;
0011 import org.apache.thrift.scheme.StandardScheme;
0012 
0013 import org.apache.thrift.scheme.TupleScheme;
0014 import org.apache.thrift.protocol.TTupleProtocol;
0015 import org.apache.thrift.protocol.TProtocolException;
0016 import org.apache.thrift.EncodingUtils;
0017 import org.apache.thrift.TException;
0018 import org.apache.thrift.async.AsyncMethodCallback;
0019 import org.apache.thrift.server.AbstractNonblockingServer.*;
0020 import java.util.List;
0021 import java.util.ArrayList;
0022 import java.util.Map;
0023 import java.util.HashMap;
0024 import java.util.EnumMap;
0025 import java.util.Set;
0026 import java.util.HashSet;
0027 import java.util.EnumSet;
0028 import java.util.Collections;
0029 import java.util.BitSet;
0030 import java.nio.ByteBuffer;
0031 import java.util.Arrays;
0032 import javax.annotation.Generated;
0033 import org.slf4j.Logger;
0034 import org.slf4j.LoggerFactory;
0035 
0036 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
0037 @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
0038 public class TArrayTypeEntry implements org.apache.thrift.TBase<TArrayTypeEntry, TArrayTypeEntry._Fields>, java.io.Serializable, Cloneable, Comparable<TArrayTypeEntry> {
0039   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TArrayTypeEntry");
0040 
0041   private static final org.apache.thrift.protocol.TField OBJECT_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("objectTypePtr", org.apache.thrift.protocol.TType.I32, (short)1);
0042 
0043   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
0044   static {
0045     schemes.put(StandardScheme.class, new TArrayTypeEntryStandardSchemeFactory());
0046     schemes.put(TupleScheme.class, new TArrayTypeEntryTupleSchemeFactory());
0047   }
0048 
0049   private int objectTypePtr; // required
0050 
0051   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
0052   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0053     OBJECT_TYPE_PTR((short)1, "objectTypePtr");
0054 
0055     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0056 
0057     static {
0058       for (_Fields field : EnumSet.allOf(_Fields.class)) {
0059         byName.put(field.getFieldName(), field);
0060       }
0061     }
0062 
0063     /**
0064      * Find the _Fields constant that matches fieldId, or null if its not found.
0065      */
0066     public static _Fields findByThriftId(int fieldId) {
0067       switch(fieldId) {
0068         case 1: // OBJECT_TYPE_PTR
0069           return OBJECT_TYPE_PTR;
0070         default:
0071           return null;
0072       }
0073     }
0074 
0075     /**
0076      * Find the _Fields constant that matches fieldId, throwing an exception
0077      * if it is not found.
0078      */
0079     public static _Fields findByThriftIdOrThrow(int fieldId) {
0080       _Fields fields = findByThriftId(fieldId);
0081       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0082       return fields;
0083     }
0084 
0085     /**
0086      * Find the _Fields constant that matches name, or null if its not found.
0087      */
0088     public static _Fields findByName(String name) {
0089       return byName.get(name);
0090     }
0091 
0092     private final short _thriftId;
0093     private final String _fieldName;
0094 
0095     _Fields(short thriftId, String fieldName) {
0096       _thriftId = thriftId;
0097       _fieldName = fieldName;
0098     }
0099 
0100     public short getThriftFieldId() {
0101       return _thriftId;
0102     }
0103 
0104     public String getFieldName() {
0105       return _fieldName;
0106     }
0107   }
0108 
0109   // isset id assignments
0110   private static final int __OBJECTTYPEPTR_ISSET_ID = 0;
0111   private byte __isset_bitfield = 0;
0112   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0113   static {
0114     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0115     tmpMap.put(_Fields.OBJECT_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("objectTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0116         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32        , "TTypeEntryPtr")));
0117     metaDataMap = Collections.unmodifiableMap(tmpMap);
0118     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TArrayTypeEntry.class, metaDataMap);
0119   }
0120 
0121   public TArrayTypeEntry() {
0122   }
0123 
0124   public TArrayTypeEntry(
0125     int objectTypePtr)
0126   {
0127     this();
0128     this.objectTypePtr = objectTypePtr;
0129     setObjectTypePtrIsSet(true);
0130   }
0131 
0132   /**
0133    * Performs a deep copy on <i>other</i>.
0134    */
0135   public TArrayTypeEntry(TArrayTypeEntry other) {
0136     __isset_bitfield = other.__isset_bitfield;
0137     this.objectTypePtr = other.objectTypePtr;
0138   }
0139 
0140   public TArrayTypeEntry deepCopy() {
0141     return new TArrayTypeEntry(this);
0142   }
0143 
0144   @Override
0145   public void clear() {
0146     setObjectTypePtrIsSet(false);
0147     this.objectTypePtr = 0;
0148   }
0149 
0150   public int getObjectTypePtr() {
0151     return this.objectTypePtr;
0152   }
0153 
0154   public void setObjectTypePtr(int objectTypePtr) {
0155     this.objectTypePtr = objectTypePtr;
0156     setObjectTypePtrIsSet(true);
0157   }
0158 
0159   public void unsetObjectTypePtr() {
0160     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID);
0161   }
0162 
0163   /** Returns true if field objectTypePtr is set (has been assigned a value) and false otherwise */
0164   public boolean isSetObjectTypePtr() {
0165     return EncodingUtils.testBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID);
0166   }
0167 
0168   public void setObjectTypePtrIsSet(boolean value) {
0169     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID, value);
0170   }
0171 
0172   public void setFieldValue(_Fields field, Object value) {
0173     switch (field) {
0174     case OBJECT_TYPE_PTR:
0175       if (value == null) {
0176         unsetObjectTypePtr();
0177       } else {
0178         setObjectTypePtr((Integer)value);
0179       }
0180       break;
0181 
0182     }
0183   }
0184 
0185   public Object getFieldValue(_Fields field) {
0186     switch (field) {
0187     case OBJECT_TYPE_PTR:
0188       return getObjectTypePtr();
0189 
0190     }
0191     throw new IllegalStateException();
0192   }
0193 
0194   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
0195   public boolean isSet(_Fields field) {
0196     if (field == null) {
0197       throw new IllegalArgumentException();
0198     }
0199 
0200     switch (field) {
0201     case OBJECT_TYPE_PTR:
0202       return isSetObjectTypePtr();
0203     }
0204     throw new IllegalStateException();
0205   }
0206 
0207   @Override
0208   public boolean equals(Object that) {
0209     if (that == null)
0210       return false;
0211     if (that instanceof TArrayTypeEntry)
0212       return this.equals((TArrayTypeEntry)that);
0213     return false;
0214   }
0215 
0216   public boolean equals(TArrayTypeEntry that) {
0217     if (that == null)
0218       return false;
0219 
0220     boolean this_present_objectTypePtr = true;
0221     boolean that_present_objectTypePtr = true;
0222     if (this_present_objectTypePtr || that_present_objectTypePtr) {
0223       if (!(this_present_objectTypePtr && that_present_objectTypePtr))
0224         return false;
0225       if (this.objectTypePtr != that.objectTypePtr)
0226         return false;
0227     }
0228 
0229     return true;
0230   }
0231 
0232   @Override
0233   public int hashCode() {
0234     List<Object> list = new ArrayList<Object>();
0235 
0236     boolean present_objectTypePtr = true;
0237     list.add(present_objectTypePtr);
0238     if (present_objectTypePtr)
0239       list.add(objectTypePtr);
0240 
0241     return list.hashCode();
0242   }
0243 
0244   @Override
0245   public int compareTo(TArrayTypeEntry other) {
0246     if (!getClass().equals(other.getClass())) {
0247       return getClass().getName().compareTo(other.getClass().getName());
0248     }
0249 
0250     int lastComparison = 0;
0251 
0252     lastComparison = Boolean.valueOf(isSetObjectTypePtr()).compareTo(other.isSetObjectTypePtr());
0253     if (lastComparison != 0) {
0254       return lastComparison;
0255     }
0256     if (isSetObjectTypePtr()) {
0257       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objectTypePtr, other.objectTypePtr);
0258       if (lastComparison != 0) {
0259         return lastComparison;
0260       }
0261     }
0262     return 0;
0263   }
0264 
0265   public _Fields fieldForId(int fieldId) {
0266     return _Fields.findByThriftId(fieldId);
0267   }
0268 
0269   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0270     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0271   }
0272 
0273   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0274     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0275   }
0276 
0277   @Override
0278   public String toString() {
0279     StringBuilder sb = new StringBuilder("TArrayTypeEntry(");
0280     boolean first = true;
0281 
0282     sb.append("objectTypePtr:");
0283     sb.append(this.objectTypePtr);
0284     first = false;
0285     sb.append(")");
0286     return sb.toString();
0287   }
0288 
0289   public void validate() throws org.apache.thrift.TException {
0290     // check for required fields
0291     if (!isSetObjectTypePtr()) {
0292       throw new org.apache.thrift.protocol.TProtocolException("Required field 'objectTypePtr' is unset! Struct:" + toString());
0293     }
0294 
0295     // check for sub-struct validity
0296   }
0297 
0298   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0299     try {
0300       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0301     } catch (org.apache.thrift.TException te) {
0302       throw new java.io.IOException(te);
0303     }
0304   }
0305 
0306   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0307     try {
0308       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
0309       __isset_bitfield = 0;
0310       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0311     } catch (org.apache.thrift.TException te) {
0312       throw new java.io.IOException(te);
0313     }
0314   }
0315 
0316   private static class TArrayTypeEntryStandardSchemeFactory implements SchemeFactory {
0317     public TArrayTypeEntryStandardScheme getScheme() {
0318       return new TArrayTypeEntryStandardScheme();
0319     }
0320   }
0321 
0322   private static class TArrayTypeEntryStandardScheme extends StandardScheme<TArrayTypeEntry> {
0323 
0324     public void read(org.apache.thrift.protocol.TProtocol iprot, TArrayTypeEntry struct) throws org.apache.thrift.TException {
0325       org.apache.thrift.protocol.TField schemeField;
0326       iprot.readStructBegin();
0327       while (true)
0328       {
0329         schemeField = iprot.readFieldBegin();
0330         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
0331           break;
0332         }
0333         switch (schemeField.id) {
0334           case 1: // OBJECT_TYPE_PTR
0335             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
0336               struct.objectTypePtr = iprot.readI32();
0337               struct.setObjectTypePtrIsSet(true);
0338             } else { 
0339               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0340             }
0341             break;
0342           default:
0343             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0344         }
0345         iprot.readFieldEnd();
0346       }
0347       iprot.readStructEnd();
0348       struct.validate();
0349     }
0350 
0351     public void write(org.apache.thrift.protocol.TProtocol oprot, TArrayTypeEntry struct) throws org.apache.thrift.TException {
0352       struct.validate();
0353 
0354       oprot.writeStructBegin(STRUCT_DESC);
0355       oprot.writeFieldBegin(OBJECT_TYPE_PTR_FIELD_DESC);
0356       oprot.writeI32(struct.objectTypePtr);
0357       oprot.writeFieldEnd();
0358       oprot.writeFieldStop();
0359       oprot.writeStructEnd();
0360     }
0361 
0362   }
0363 
0364   private static class TArrayTypeEntryTupleSchemeFactory implements SchemeFactory {
0365     public TArrayTypeEntryTupleScheme getScheme() {
0366       return new TArrayTypeEntryTupleScheme();
0367     }
0368   }
0369 
0370   private static class TArrayTypeEntryTupleScheme extends TupleScheme<TArrayTypeEntry> {
0371 
0372     @Override
0373     public void write(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException {
0374       TTupleProtocol oprot = (TTupleProtocol) prot;
0375       oprot.writeI32(struct.objectTypePtr);
0376     }
0377 
0378     @Override
0379     public void read(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException {
0380       TTupleProtocol iprot = (TTupleProtocol) prot;
0381       struct.objectTypePtr = iprot.readI32();
0382       struct.setObjectTypePtrIsSet(true);
0383     }
0384   }
0385 
0386 }
0387