Back to home page

OSCL-LXR

 
 

    


0001 /**
0002  * Autogenerated by Thrift Compiler (0.9.0)
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.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 TCancelDelegationTokenResp implements org.apache.thrift.TBase<TCancelDelegationTokenResp, TCancelDelegationTokenResp._Fields>, java.io.Serializable, Cloneable {
0035   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenResp");
0036 
0037   private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
0038 
0039   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
0040   static {
0041     schemes.put(StandardScheme.class, new TCancelDelegationTokenRespStandardSchemeFactory());
0042     schemes.put(TupleScheme.class, new TCancelDelegationTokenRespTupleSchemeFactory());
0043   }
0044 
0045   private TStatus status; // required
0046 
0047   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
0048   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0049     STATUS((short)1, "status");
0050 
0051     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0052 
0053     static {
0054       for (_Fields field : EnumSet.allOf(_Fields.class)) {
0055         byName.put(field.getFieldName(), field);
0056       }
0057     }
0058 
0059     /**
0060      * Find the _Fields constant that matches fieldId, or null if its not found.
0061      */
0062     public static _Fields findByThriftId(int fieldId) {
0063       switch(fieldId) {
0064         case 1: // STATUS
0065           return STATUS;
0066         default:
0067           return null;
0068       }
0069     }
0070 
0071     /**
0072      * Find the _Fields constant that matches fieldId, throwing an exception
0073      * if it is not found.
0074      */
0075     public static _Fields findByThriftIdOrThrow(int fieldId) {
0076       _Fields fields = findByThriftId(fieldId);
0077       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0078       return fields;
0079     }
0080 
0081     /**
0082      * Find the _Fields constant that matches name, or null if its not found.
0083      */
0084     public static _Fields findByName(String name) {
0085       return byName.get(name);
0086     }
0087 
0088     private final short _thriftId;
0089     private final String _fieldName;
0090 
0091     _Fields(short thriftId, String fieldName) {
0092       _thriftId = thriftId;
0093       _fieldName = fieldName;
0094     }
0095 
0096     public short getThriftFieldId() {
0097       return _thriftId;
0098     }
0099 
0100     public String getFieldName() {
0101       return _fieldName;
0102     }
0103   }
0104 
0105   // isset id assignments
0106   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0107   static {
0108     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0109     tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0110         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class)));
0111     metaDataMap = Collections.unmodifiableMap(tmpMap);
0112     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenResp.class, metaDataMap);
0113   }
0114 
0115   public TCancelDelegationTokenResp() {
0116   }
0117 
0118   public TCancelDelegationTokenResp(
0119     TStatus status)
0120   {
0121     this();
0122     this.status = status;
0123   }
0124 
0125   /**
0126    * Performs a deep copy on <i>other</i>.
0127    */
0128   public TCancelDelegationTokenResp(TCancelDelegationTokenResp other) {
0129     if (other.isSetStatus()) {
0130       this.status = new TStatus(other.status);
0131     }
0132   }
0133 
0134   public TCancelDelegationTokenResp deepCopy() {
0135     return new TCancelDelegationTokenResp(this);
0136   }
0137 
0138   @Override
0139   public void clear() {
0140     this.status = null;
0141   }
0142 
0143   public TStatus getStatus() {
0144     return this.status;
0145   }
0146 
0147   public void setStatus(TStatus status) {
0148     this.status = status;
0149   }
0150 
0151   public void unsetStatus() {
0152     this.status = null;
0153   }
0154 
0155   /** Returns true if field status is set (has been assigned a value) and false otherwise */
0156   public boolean isSetStatus() {
0157     return this.status != null;
0158   }
0159 
0160   public void setStatusIsSet(boolean value) {
0161     if (!value) {
0162       this.status = null;
0163     }
0164   }
0165 
0166   public void setFieldValue(_Fields field, Object value) {
0167     switch (field) {
0168     case STATUS:
0169       if (value == null) {
0170         unsetStatus();
0171       } else {
0172         setStatus((TStatus)value);
0173       }
0174       break;
0175 
0176     }
0177   }
0178 
0179   public Object getFieldValue(_Fields field) {
0180     switch (field) {
0181     case STATUS:
0182       return getStatus();
0183 
0184     }
0185     throw new IllegalStateException();
0186   }
0187 
0188   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
0189   public boolean isSet(_Fields field) {
0190     if (field == null) {
0191       throw new IllegalArgumentException();
0192     }
0193 
0194     switch (field) {
0195     case STATUS:
0196       return isSetStatus();
0197     }
0198     throw new IllegalStateException();
0199   }
0200 
0201   @Override
0202   public boolean equals(Object that) {
0203     if (that == null)
0204       return false;
0205     if (that instanceof TCancelDelegationTokenResp)
0206       return this.equals((TCancelDelegationTokenResp)that);
0207     return false;
0208   }
0209 
0210   public boolean equals(TCancelDelegationTokenResp that) {
0211     if (that == null)
0212       return false;
0213 
0214     boolean this_present_status = true && this.isSetStatus();
0215     boolean that_present_status = true && that.isSetStatus();
0216     if (this_present_status || that_present_status) {
0217       if (!(this_present_status && that_present_status))
0218         return false;
0219       if (!this.status.equals(that.status))
0220         return false;
0221     }
0222 
0223     return true;
0224   }
0225 
0226   @Override
0227   public int hashCode() {
0228     HashCodeBuilder builder = new HashCodeBuilder();
0229 
0230     boolean present_status = true && (isSetStatus());
0231     builder.append(present_status);
0232     if (present_status)
0233       builder.append(status);
0234 
0235     return builder.toHashCode();
0236   }
0237 
0238   public int compareTo(TCancelDelegationTokenResp other) {
0239     if (!getClass().equals(other.getClass())) {
0240       return getClass().getName().compareTo(other.getClass().getName());
0241     }
0242 
0243     int lastComparison = 0;
0244     TCancelDelegationTokenResp typedOther = (TCancelDelegationTokenResp)other;
0245 
0246     lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
0247     if (lastComparison != 0) {
0248       return lastComparison;
0249     }
0250     if (isSetStatus()) {
0251       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
0252       if (lastComparison != 0) {
0253         return lastComparison;
0254       }
0255     }
0256     return 0;
0257   }
0258 
0259   public _Fields fieldForId(int fieldId) {
0260     return _Fields.findByThriftId(fieldId);
0261   }
0262 
0263   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0264     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0265   }
0266 
0267   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0268     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0269   }
0270 
0271   @Override
0272   public String toString() {
0273     StringBuilder sb = new StringBuilder("TCancelDelegationTokenResp(");
0274     boolean first = true;
0275 
0276     sb.append("status:");
0277     if (this.status == null) {
0278       sb.append("null");
0279     } else {
0280       sb.append(this.status);
0281     }
0282     first = false;
0283     sb.append(")");
0284     return sb.toString();
0285   }
0286 
0287   public void validate() throws org.apache.thrift.TException {
0288     // check for required fields
0289     if (!isSetStatus()) {
0290       throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
0291     }
0292 
0293     // check for sub-struct validity
0294     if (status != null) {
0295       status.validate();
0296     }
0297   }
0298 
0299   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0300     try {
0301       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0302     } catch (org.apache.thrift.TException te) {
0303       throw new java.io.IOException(te);
0304     }
0305   }
0306 
0307   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0308     try {
0309       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0310     } catch (org.apache.thrift.TException te) {
0311       throw new java.io.IOException(te);
0312     }
0313   }
0314 
0315   private static class TCancelDelegationTokenRespStandardSchemeFactory implements SchemeFactory {
0316     public TCancelDelegationTokenRespStandardScheme getScheme() {
0317       return new TCancelDelegationTokenRespStandardScheme();
0318     }
0319   }
0320 
0321   private static class TCancelDelegationTokenRespStandardScheme extends StandardScheme<TCancelDelegationTokenResp> {
0322 
0323     public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException {
0324       org.apache.thrift.protocol.TField schemeField;
0325       iprot.readStructBegin();
0326       while (true)
0327       {
0328         schemeField = iprot.readFieldBegin();
0329         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
0330           break;
0331         }
0332         switch (schemeField.id) {
0333           case 1: // STATUS
0334             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0335               struct.status = new TStatus();
0336               struct.status.read(iprot);
0337               struct.setStatusIsSet(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, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException {
0352       struct.validate();
0353 
0354       oprot.writeStructBegin(STRUCT_DESC);
0355       if (struct.status != null) {
0356         oprot.writeFieldBegin(STATUS_FIELD_DESC);
0357         struct.status.write(oprot);
0358         oprot.writeFieldEnd();
0359       }
0360       oprot.writeFieldStop();
0361       oprot.writeStructEnd();
0362     }
0363 
0364   }
0365 
0366   private static class TCancelDelegationTokenRespTupleSchemeFactory implements SchemeFactory {
0367     public TCancelDelegationTokenRespTupleScheme getScheme() {
0368       return new TCancelDelegationTokenRespTupleScheme();
0369     }
0370   }
0371 
0372   private static class TCancelDelegationTokenRespTupleScheme extends TupleScheme<TCancelDelegationTokenResp> {
0373 
0374     @Override
0375     public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException {
0376       TTupleProtocol oprot = (TTupleProtocol) prot;
0377       struct.status.write(oprot);
0378     }
0379 
0380     @Override
0381     public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException {
0382       TTupleProtocol iprot = (TTupleProtocol) prot;
0383       struct.status = new TStatus();
0384       struct.status.read(iprot);
0385       struct.setStatusIsSet(true);
0386     }
0387   }
0388 
0389 }
0390