PageRenderTime 23ms CodeModel.GetById 8ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ConfigValSecurityException.java

#
Java | 306 lines | 233 code | 50 blank | 23 comment | 44 complexity | b27c8b5e836e4354c0dd089bf2a8d577 MD5 | raw file
  1/**
  2 * Autogenerated by Thrift
  3 *
  4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  5 */
  6package org.apache.hadoop.hive.metastore.api;
  7
  8import java.util.List;
  9import java.util.ArrayList;
 10import java.util.Map;
 11import java.util.HashMap;
 12import java.util.EnumMap;
 13import java.util.Set;
 14import java.util.HashSet;
 15import java.util.EnumSet;
 16import java.util.Collections;
 17import java.util.BitSet;
 18import java.nio.ByteBuffer;
 19import java.util.Arrays;
 20import org.slf4j.Logger;
 21import org.slf4j.LoggerFactory;
 22
 23import org.apache.thrift.*;
 24import org.apache.thrift.async.*;
 25import org.apache.thrift.meta_data.*;
 26import org.apache.thrift.transport.*;
 27import org.apache.thrift.protocol.*;
 28
 29public class ConfigValSecurityException extends Exception implements TBase<ConfigValSecurityException, ConfigValSecurityException._Fields>, java.io.Serializable, Cloneable {
 30  private static final TStruct STRUCT_DESC = new TStruct("ConfigValSecurityException");
 31
 32  private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1);
 33
 34  private String message;
 35
 36  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
 37  public enum _Fields implements TFieldIdEnum {
 38    MESSAGE((short)1, "message");
 39
 40    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 41
 42    static {
 43      for (_Fields field : EnumSet.allOf(_Fields.class)) {
 44        byName.put(field.getFieldName(), field);
 45      }
 46    }
 47
 48    /**
 49     * Find the _Fields constant that matches fieldId, or null if its not found.
 50     */
 51    public static _Fields findByThriftId(int fieldId) {
 52      switch(fieldId) {
 53        case 1: // MESSAGE
 54          return MESSAGE;
 55        default:
 56          return null;
 57      }
 58    }
 59
 60    /**
 61     * Find the _Fields constant that matches fieldId, throwing an exception
 62     * if it is not found.
 63     */
 64    public static _Fields findByThriftIdOrThrow(int fieldId) {
 65      _Fields fields = findByThriftId(fieldId);
 66      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
 67      return fields;
 68    }
 69
 70    /**
 71     * Find the _Fields constant that matches name, or null if its not found.
 72     */
 73    public static _Fields findByName(String name) {
 74      return byName.get(name);
 75    }
 76
 77    private final short _thriftId;
 78    private final String _fieldName;
 79
 80    _Fields(short thriftId, String fieldName) {
 81      _thriftId = thriftId;
 82      _fieldName = fieldName;
 83    }
 84
 85    public short getThriftFieldId() {
 86      return _thriftId;
 87    }
 88
 89    public String getFieldName() {
 90      return _fieldName;
 91    }
 92  }
 93
 94  // isset id assignments
 95
 96  public static final Map<_Fields, FieldMetaData> metaDataMap;
 97  static {
 98    Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
 99    tmpMap.put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT, 
100        new FieldValueMetaData(TType.STRING)));
101    metaDataMap = Collections.unmodifiableMap(tmpMap);
102    FieldMetaData.addStructMetaDataMap(ConfigValSecurityException.class, metaDataMap);
103  }
104
105  public ConfigValSecurityException() {
106  }
107
108  public ConfigValSecurityException(
109    String message)
110  {
111    this();
112    this.message = message;
113  }
114
115  /**
116   * Performs a deep copy on <i>other</i>.
117   */
118  public ConfigValSecurityException(ConfigValSecurityException other) {
119    if (other.isSetMessage()) {
120      this.message = other.message;
121    }
122  }
123
124  public ConfigValSecurityException deepCopy() {
125    return new ConfigValSecurityException(this);
126  }
127
128  @Override
129  public void clear() {
130    this.message = null;
131  }
132
133  public String getMessage() {
134    return this.message;
135  }
136
137  public void setMessage(String message) {
138    this.message = message;
139  }
140
141  public void unsetMessage() {
142    this.message = null;
143  }
144
145  /** Returns true if field message is set (has been asigned a value) and false otherwise */
146  public boolean isSetMessage() {
147    return this.message != null;
148  }
149
150  public void setMessageIsSet(boolean value) {
151    if (!value) {
152      this.message = null;
153    }
154  }
155
156  public void setFieldValue(_Fields field, Object value) {
157    switch (field) {
158    case MESSAGE:
159      if (value == null) {
160        unsetMessage();
161      } else {
162        setMessage((String)value);
163      }
164      break;
165
166    }
167  }
168
169  public Object getFieldValue(_Fields field) {
170    switch (field) {
171    case MESSAGE:
172      return getMessage();
173
174    }
175    throw new IllegalStateException();
176  }
177
178  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
179  public boolean isSet(_Fields field) {
180    if (field == null) {
181      throw new IllegalArgumentException();
182    }
183
184    switch (field) {
185    case MESSAGE:
186      return isSetMessage();
187    }
188    throw new IllegalStateException();
189  }
190
191  @Override
192  public boolean equals(Object that) {
193    if (that == null)
194      return false;
195    if (that instanceof ConfigValSecurityException)
196      return this.equals((ConfigValSecurityException)that);
197    return false;
198  }
199
200  public boolean equals(ConfigValSecurityException that) {
201    if (that == null)
202      return false;
203
204    boolean this_present_message = true && this.isSetMessage();
205    boolean that_present_message = true && that.isSetMessage();
206    if (this_present_message || that_present_message) {
207      if (!(this_present_message && that_present_message))
208        return false;
209      if (!this.message.equals(that.message))
210        return false;
211    }
212
213    return true;
214  }
215
216  @Override
217  public int hashCode() {
218    return 0;
219  }
220
221  public int compareTo(ConfigValSecurityException other) {
222    if (!getClass().equals(other.getClass())) {
223      return getClass().getName().compareTo(other.getClass().getName());
224    }
225
226    int lastComparison = 0;
227    ConfigValSecurityException typedOther = (ConfigValSecurityException)other;
228
229    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
230    if (lastComparison != 0) {
231      return lastComparison;
232    }
233    if (isSetMessage()) {
234      lastComparison = TBaseHelper.compareTo(this.message, typedOther.message);
235      if (lastComparison != 0) {
236        return lastComparison;
237      }
238    }
239    return 0;
240  }
241
242  public _Fields fieldForId(int fieldId) {
243    return _Fields.findByThriftId(fieldId);
244  }
245
246  public void read(TProtocol iprot) throws TException {
247    TField field;
248    iprot.readStructBegin();
249    while (true)
250    {
251      field = iprot.readFieldBegin();
252      if (field.type == TType.STOP) { 
253        break;
254      }
255      switch (field.id) {
256        case 1: // MESSAGE
257          if (field.type == TType.STRING) {
258            this.message = iprot.readString();
259          } else { 
260            TProtocolUtil.skip(iprot, field.type);
261          }
262          break;
263        default:
264          TProtocolUtil.skip(iprot, field.type);
265      }
266      iprot.readFieldEnd();
267    }
268    iprot.readStructEnd();
269    validate();
270  }
271
272  public void write(TProtocol oprot) throws TException {
273    validate();
274
275    oprot.writeStructBegin(STRUCT_DESC);
276    if (this.message != null) {
277      oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
278      oprot.writeString(this.message);
279      oprot.writeFieldEnd();
280    }
281    oprot.writeFieldStop();
282    oprot.writeStructEnd();
283  }
284
285  @Override
286  public String toString() {
287    StringBuilder sb = new StringBuilder("ConfigValSecurityException(");
288    boolean first = true;
289
290    sb.append("message:");
291    if (this.message == null) {
292      sb.append("null");
293    } else {
294      sb.append(this.message);
295    }
296    first = false;
297    sb.append(")");
298    return sb.toString();
299  }
300
301  public void validate() throws TException {
302    // check for required fields
303  }
304
305}
306