PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/proto_src/org/waveprotocol/wave/federation/FederationErrorProto.java

https://code.google.com/p/wave-protocol/
Java | 483 lines | 424 code | 47 blank | 12 comment | 38 complexity | c435ee170bcb9ae3d1f5108c8f3a8210 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-3.0, CPL-1.0, Apache-2.0, MIT
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: org/waveprotocol/wave/federation/federation_error.protodevel
  3. package org.waveprotocol.wave.federation;
  4. public final class FederationErrorProto {
  5. private FederationErrorProto() {}
  6. public static void registerAllExtensions(
  7. com.google.protobuf.ExtensionRegistry registry) {
  8. }
  9. public static final class FederationError extends
  10. com.google.protobuf.GeneratedMessage {
  11. // Use FederationError.newBuilder() to construct.
  12. private FederationError() {
  13. initFields();
  14. }
  15. private FederationError(boolean noInit) {}
  16. private static final FederationError defaultInstance;
  17. public static FederationError getDefaultInstance() {
  18. return defaultInstance;
  19. }
  20. public FederationError getDefaultInstanceForType() {
  21. return defaultInstance;
  22. }
  23. public static final com.google.protobuf.Descriptors.Descriptor
  24. getDescriptor() {
  25. return org.waveprotocol.wave.federation.FederationErrorProto.internal_static_federation_FederationError_descriptor;
  26. }
  27. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  28. internalGetFieldAccessorTable() {
  29. return org.waveprotocol.wave.federation.FederationErrorProto.internal_static_federation_FederationError_fieldAccessorTable;
  30. }
  31. public enum Code
  32. implements com.google.protobuf.ProtocolMessageEnum {
  33. OK(0, 0),
  34. BAD_REQUEST(1, 1),
  35. ITEM_NOT_FOUND(2, 2),
  36. NOT_ACCEPTABLE(3, 3),
  37. NOT_AUTHORIZED(4, 4),
  38. RESOURCE_CONSTRAINT(5, 5),
  39. UNDEFINED_CONDITION(6, 6),
  40. REMOTE_SERVER_TIMEOUT(7, 7),
  41. UNEXPECTED_REQUEST(8, 8),
  42. INTERNAL_SERVER_ERROR(9, 9),
  43. ;
  44. public final int getNumber() { return value; }
  45. public static Code valueOf(int value) {
  46. switch (value) {
  47. case 0: return OK;
  48. case 1: return BAD_REQUEST;
  49. case 2: return ITEM_NOT_FOUND;
  50. case 3: return NOT_ACCEPTABLE;
  51. case 4: return NOT_AUTHORIZED;
  52. case 5: return RESOURCE_CONSTRAINT;
  53. case 6: return UNDEFINED_CONDITION;
  54. case 7: return REMOTE_SERVER_TIMEOUT;
  55. case 8: return UNEXPECTED_REQUEST;
  56. case 9: return INTERNAL_SERVER_ERROR;
  57. default: return null;
  58. }
  59. }
  60. public static com.google.protobuf.Internal.EnumLiteMap<Code>
  61. internalGetValueMap() {
  62. return internalValueMap;
  63. }
  64. private static com.google.protobuf.Internal.EnumLiteMap<Code>
  65. internalValueMap =
  66. new com.google.protobuf.Internal.EnumLiteMap<Code>() {
  67. public Code findValueByNumber(int number) {
  68. return Code.valueOf(number)
  69. ; }
  70. };
  71. public final com.google.protobuf.Descriptors.EnumValueDescriptor
  72. getValueDescriptor() {
  73. return getDescriptor().getValues().get(index);
  74. }
  75. public final com.google.protobuf.Descriptors.EnumDescriptor
  76. getDescriptorForType() {
  77. return getDescriptor();
  78. }
  79. public static final com.google.protobuf.Descriptors.EnumDescriptor
  80. getDescriptor() {
  81. return org.waveprotocol.wave.federation.FederationErrorProto.FederationError.getDescriptor().getEnumTypes().get(0);
  82. }
  83. private static final Code[] VALUES = {
  84. OK, BAD_REQUEST, ITEM_NOT_FOUND, NOT_ACCEPTABLE, NOT_AUTHORIZED, RESOURCE_CONSTRAINT, UNDEFINED_CONDITION, REMOTE_SERVER_TIMEOUT, UNEXPECTED_REQUEST, INTERNAL_SERVER_ERROR,
  85. };
  86. public static Code valueOf(
  87. com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
  88. if (desc.getType() != getDescriptor()) {
  89. throw new java.lang.IllegalArgumentException(
  90. "EnumValueDescriptor is not for this type.");
  91. }
  92. return VALUES[desc.getIndex()];
  93. }
  94. private final int index;
  95. private final int value;
  96. private Code(int index, int value) {
  97. this.index = index;
  98. this.value = value;
  99. }
  100. static {
  101. org.waveprotocol.wave.federation.FederationErrorProto.getDescriptor();
  102. }
  103. // @@protoc_insertion_point(enum_scope:federation.FederationError.Code)
  104. }
  105. // required .federation.FederationError.Code error_code = 1;
  106. public static final int ERROR_CODE_FIELD_NUMBER = 1;
  107. private boolean hasErrorCode;
  108. private org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code errorCode_;
  109. public boolean hasErrorCode() { return hasErrorCode; }
  110. public org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code getErrorCode() { return errorCode_; }
  111. // optional string error_message = 2;
  112. public static final int ERROR_MESSAGE_FIELD_NUMBER = 2;
  113. private boolean hasErrorMessage;
  114. private java.lang.String errorMessage_ = "";
  115. public boolean hasErrorMessage() { return hasErrorMessage; }
  116. public java.lang.String getErrorMessage() { return errorMessage_; }
  117. private void initFields() {
  118. errorCode_ = org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code.OK;
  119. }
  120. public final boolean isInitialized() {
  121. if (!hasErrorCode) return false;
  122. return true;
  123. }
  124. public void writeTo(com.google.protobuf.CodedOutputStream output)
  125. throws java.io.IOException {
  126. getSerializedSize();
  127. if (hasErrorCode()) {
  128. output.writeEnum(1, getErrorCode().getNumber());
  129. }
  130. if (hasErrorMessage()) {
  131. output.writeString(2, getErrorMessage());
  132. }
  133. getUnknownFields().writeTo(output);
  134. }
  135. private int memoizedSerializedSize = -1;
  136. public int getSerializedSize() {
  137. int size = memoizedSerializedSize;
  138. if (size != -1) return size;
  139. size = 0;
  140. if (hasErrorCode()) {
  141. size += com.google.protobuf.CodedOutputStream
  142. .computeEnumSize(1, getErrorCode().getNumber());
  143. }
  144. if (hasErrorMessage()) {
  145. size += com.google.protobuf.CodedOutputStream
  146. .computeStringSize(2, getErrorMessage());
  147. }
  148. size += getUnknownFields().getSerializedSize();
  149. memoizedSerializedSize = size;
  150. return size;
  151. }
  152. public static org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
  153. com.google.protobuf.ByteString data)
  154. throws com.google.protobuf.InvalidProtocolBufferException {
  155. return newBuilder().mergeFrom(data).buildParsed();
  156. }
  157. public static org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
  158. com.google.protobuf.ByteString data,
  159. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  160. throws com.google.protobuf.InvalidProtocolBufferException {
  161. return newBuilder().mergeFrom(data, extensionRegistry)
  162. .buildParsed();
  163. }
  164. public static org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(byte[] data)
  165. throws com.google.protobuf.InvalidProtocolBufferException {
  166. return newBuilder().mergeFrom(data).buildParsed();
  167. }
  168. public static org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
  169. byte[] data,
  170. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  171. throws com.google.protobuf.InvalidProtocolBufferException {
  172. return newBuilder().mergeFrom(data, extensionRegistry)
  173. .buildParsed();
  174. }
  175. public static org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(java.io.InputStream input)
  176. throws java.io.IOException {
  177. return newBuilder().mergeFrom(input).buildParsed();
  178. }
  179. public static org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
  180. java.io.InputStream input,
  181. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  182. throws java.io.IOException {
  183. return newBuilder().mergeFrom(input, extensionRegistry)
  184. .buildParsed();
  185. }
  186. public static org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseDelimitedFrom(java.io.InputStream input)
  187. throws java.io.IOException {
  188. Builder builder = newBuilder();
  189. if (builder.mergeDelimitedFrom(input)) {
  190. return builder.buildParsed();
  191. } else {
  192. return null;
  193. }
  194. }
  195. public static org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseDelimitedFrom(
  196. java.io.InputStream input,
  197. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  198. throws java.io.IOException {
  199. Builder builder = newBuilder();
  200. if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
  201. return builder.buildParsed();
  202. } else {
  203. return null;
  204. }
  205. }
  206. public static org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
  207. com.google.protobuf.CodedInputStream input)
  208. throws java.io.IOException {
  209. return newBuilder().mergeFrom(input).buildParsed();
  210. }
  211. public static org.waveprotocol.wave.federation.FederationErrorProto.FederationError parseFrom(
  212. com.google.protobuf.CodedInputStream input,
  213. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  214. throws java.io.IOException {
  215. return newBuilder().mergeFrom(input, extensionRegistry)
  216. .buildParsed();
  217. }
  218. public static Builder newBuilder() { return Builder.create(); }
  219. public Builder newBuilderForType() { return newBuilder(); }
  220. public static Builder newBuilder(org.waveprotocol.wave.federation.FederationErrorProto.FederationError prototype) {
  221. return newBuilder().mergeFrom(prototype);
  222. }
  223. public Builder toBuilder() { return newBuilder(this); }
  224. public static final class Builder extends
  225. com.google.protobuf.GeneratedMessage.Builder<Builder> {
  226. private org.waveprotocol.wave.federation.FederationErrorProto.FederationError result;
  227. // Construct using org.waveprotocol.wave.federation.FederationErrorProto.FederationError.newBuilder()
  228. private Builder() {}
  229. private static Builder create() {
  230. Builder builder = new Builder();
  231. builder.result = new org.waveprotocol.wave.federation.FederationErrorProto.FederationError();
  232. return builder;
  233. }
  234. protected org.waveprotocol.wave.federation.FederationErrorProto.FederationError internalGetResult() {
  235. return result;
  236. }
  237. public Builder clear() {
  238. if (result == null) {
  239. throw new IllegalStateException(
  240. "Cannot call clear() after build().");
  241. }
  242. result = new org.waveprotocol.wave.federation.FederationErrorProto.FederationError();
  243. return this;
  244. }
  245. public Builder clone() {
  246. return create().mergeFrom(result);
  247. }
  248. public com.google.protobuf.Descriptors.Descriptor
  249. getDescriptorForType() {
  250. return org.waveprotocol.wave.federation.FederationErrorProto.FederationError.getDescriptor();
  251. }
  252. public org.waveprotocol.wave.federation.FederationErrorProto.FederationError getDefaultInstanceForType() {
  253. return org.waveprotocol.wave.federation.FederationErrorProto.FederationError.getDefaultInstance();
  254. }
  255. public boolean isInitialized() {
  256. return result.isInitialized();
  257. }
  258. public org.waveprotocol.wave.federation.FederationErrorProto.FederationError build() {
  259. if (result != null && !isInitialized()) {
  260. throw newUninitializedMessageException(result);
  261. }
  262. return buildPartial();
  263. }
  264. private org.waveprotocol.wave.federation.FederationErrorProto.FederationError buildParsed()
  265. throws com.google.protobuf.InvalidProtocolBufferException {
  266. if (!isInitialized()) {
  267. throw newUninitializedMessageException(
  268. result).asInvalidProtocolBufferException();
  269. }
  270. return buildPartial();
  271. }
  272. public org.waveprotocol.wave.federation.FederationErrorProto.FederationError buildPartial() {
  273. if (result == null) {
  274. throw new IllegalStateException(
  275. "build() has already been called on this Builder.");
  276. }
  277. org.waveprotocol.wave.federation.FederationErrorProto.FederationError returnMe = result;
  278. result = null;
  279. return returnMe;
  280. }
  281. public Builder mergeFrom(com.google.protobuf.Message other) {
  282. if (other instanceof org.waveprotocol.wave.federation.FederationErrorProto.FederationError) {
  283. return mergeFrom((org.waveprotocol.wave.federation.FederationErrorProto.FederationError)other);
  284. } else {
  285. super.mergeFrom(other);
  286. return this;
  287. }
  288. }
  289. public Builder mergeFrom(org.waveprotocol.wave.federation.FederationErrorProto.FederationError other) {
  290. if (other == org.waveprotocol.wave.federation.FederationErrorProto.FederationError.getDefaultInstance()) return this;
  291. if (other.hasErrorCode()) {
  292. setErrorCode(other.getErrorCode());
  293. }
  294. if (other.hasErrorMessage()) {
  295. setErrorMessage(other.getErrorMessage());
  296. }
  297. this.mergeUnknownFields(other.getUnknownFields());
  298. return this;
  299. }
  300. public Builder mergeFrom(
  301. com.google.protobuf.CodedInputStream input,
  302. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  303. throws java.io.IOException {
  304. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  305. com.google.protobuf.UnknownFieldSet.newBuilder(
  306. this.getUnknownFields());
  307. while (true) {
  308. int tag = input.readTag();
  309. switch (tag) {
  310. case 0:
  311. this.setUnknownFields(unknownFields.build());
  312. return this;
  313. default: {
  314. if (!parseUnknownField(input, unknownFields,
  315. extensionRegistry, tag)) {
  316. this.setUnknownFields(unknownFields.build());
  317. return this;
  318. }
  319. break;
  320. }
  321. case 8: {
  322. int rawValue = input.readEnum();
  323. org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code value = org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code.valueOf(rawValue);
  324. if (value == null) {
  325. unknownFields.mergeVarintField(1, rawValue);
  326. } else {
  327. setErrorCode(value);
  328. }
  329. break;
  330. }
  331. case 18: {
  332. setErrorMessage(input.readString());
  333. break;
  334. }
  335. }
  336. }
  337. }
  338. // required .federation.FederationError.Code error_code = 1;
  339. public boolean hasErrorCode() {
  340. return result.hasErrorCode();
  341. }
  342. public org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code getErrorCode() {
  343. return result.getErrorCode();
  344. }
  345. public Builder setErrorCode(org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code value) {
  346. if (value == null) {
  347. throw new NullPointerException();
  348. }
  349. result.hasErrorCode = true;
  350. result.errorCode_ = value;
  351. return this;
  352. }
  353. public Builder clearErrorCode() {
  354. result.hasErrorCode = false;
  355. result.errorCode_ = org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Code.OK;
  356. return this;
  357. }
  358. // optional string error_message = 2;
  359. public boolean hasErrorMessage() {
  360. return result.hasErrorMessage();
  361. }
  362. public java.lang.String getErrorMessage() {
  363. return result.getErrorMessage();
  364. }
  365. public Builder setErrorMessage(java.lang.String value) {
  366. if (value == null) {
  367. throw new NullPointerException();
  368. }
  369. result.hasErrorMessage = true;
  370. result.errorMessage_ = value;
  371. return this;
  372. }
  373. public Builder clearErrorMessage() {
  374. result.hasErrorMessage = false;
  375. result.errorMessage_ = getDefaultInstance().getErrorMessage();
  376. return this;
  377. }
  378. // @@protoc_insertion_point(builder_scope:federation.FederationError)
  379. }
  380. static {
  381. defaultInstance = new FederationError(true);
  382. org.waveprotocol.wave.federation.FederationErrorProto.internalForceInit();
  383. defaultInstance.initFields();
  384. }
  385. // @@protoc_insertion_point(class_scope:federation.FederationError)
  386. }
  387. private static com.google.protobuf.Descriptors.Descriptor
  388. internal_static_federation_FederationError_descriptor;
  389. private static
  390. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  391. internal_static_federation_FederationError_fieldAccessorTable;
  392. public static com.google.protobuf.Descriptors.FileDescriptor
  393. getDescriptor() {
  394. return descriptor;
  395. }
  396. private static com.google.protobuf.Descriptors.FileDescriptor
  397. descriptor;
  398. static {
  399. java.lang.String[] descriptorData = {
  400. "\n<org/waveprotocol/wave/federation/feder" +
  401. "ation_error.protodevel\022\nfederation\"\274\002\n\017F" +
  402. "ederationError\0224\n\nerror_code\030\001 \002(\0162 .fed" +
  403. "eration.FederationError.Code\022\025\n\rerror_me" +
  404. "ssage\030\002 \001(\t\"\333\001\n\004Code\022\006\n\002OK\020\000\022\017\n\013BAD_REQU" +
  405. "EST\020\001\022\022\n\016ITEM_NOT_FOUND\020\002\022\022\n\016NOT_ACCEPTA" +
  406. "BLE\020\003\022\022\n\016NOT_AUTHORIZED\020\004\022\027\n\023RESOURCE_CO" +
  407. "NSTRAINT\020\005\022\027\n\023UNDEFINED_CONDITION\020\006\022\031\n\025R" +
  408. "EMOTE_SERVER_TIMEOUT\020\007\022\026\n\022UNEXPECTED_REQ" +
  409. "UEST\020\010\022\031\n\025INTERNAL_SERVER_ERROR\020\tB8\n org",
  410. ".waveprotocol.wave.federationB\024Federatio" +
  411. "nErrorProto"
  412. };
  413. com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
  414. new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
  415. public com.google.protobuf.ExtensionRegistry assignDescriptors(
  416. com.google.protobuf.Descriptors.FileDescriptor root) {
  417. descriptor = root;
  418. internal_static_federation_FederationError_descriptor =
  419. getDescriptor().getMessageTypes().get(0);
  420. internal_static_federation_FederationError_fieldAccessorTable = new
  421. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  422. internal_static_federation_FederationError_descriptor,
  423. new java.lang.String[] { "ErrorCode", "ErrorMessage", },
  424. org.waveprotocol.wave.federation.FederationErrorProto.FederationError.class,
  425. org.waveprotocol.wave.federation.FederationErrorProto.FederationError.Builder.class);
  426. return null;
  427. }
  428. };
  429. com.google.protobuf.Descriptors.FileDescriptor
  430. .internalBuildGeneratedFileFrom(descriptorData,
  431. new com.google.protobuf.Descriptors.FileDescriptor[] {
  432. }, assigner);
  433. }
  434. public static void internalForceInit() {}
  435. // @@protoc_insertion_point(outer_class_scope)
  436. }