PageRenderTime 55ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

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

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