PageRenderTime 56ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/java/src/com/google/publicalerts/cap/ValuePair.java

https://code.google.com/p/cap-library/
Java | 520 lines | 468 code | 43 blank | 9 comment | 72 complexity | d5ee56c8965dc03e27392e565b07a6c2 MD5 | raw file
Possible License(s): Apache-2.0
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. package com.google.publicalerts.cap;
  3. public final class ValuePair extends
  4. com.google.protobuf.GeneratedMessage
  5. implements ValuePairOrBuilder {
  6. // Use ValuePair.newBuilder() to construct.
  7. private ValuePair(Builder builder) {
  8. super(builder);
  9. }
  10. private ValuePair(boolean noInit) {}
  11. private static final ValuePair defaultInstance;
  12. public static ValuePair getDefaultInstance() {
  13. return defaultInstance;
  14. }
  15. public ValuePair getDefaultInstanceForType() {
  16. return defaultInstance;
  17. }
  18. public static final com.google.protobuf.Descriptors.Descriptor
  19. getDescriptor() {
  20. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_ValuePair_descriptor;
  21. }
  22. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  23. internalGetFieldAccessorTable() {
  24. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_ValuePair_fieldAccessorTable;
  25. }
  26. private int bitField0_;
  27. // required string value_name = 1;
  28. public static final int VALUE_NAME_FIELD_NUMBER = 1;
  29. private java.lang.Object valueName_;
  30. public boolean hasValueName() {
  31. return ((bitField0_ & 0x00000001) == 0x00000001);
  32. }
  33. public String getValueName() {
  34. java.lang.Object ref = valueName_;
  35. if (ref instanceof String) {
  36. return (String) ref;
  37. } else {
  38. com.google.protobuf.ByteString bs =
  39. (com.google.protobuf.ByteString) ref;
  40. String s = bs.toStringUtf8();
  41. if (com.google.protobuf.Internal.isValidUtf8(bs)) {
  42. valueName_ = s;
  43. }
  44. return s;
  45. }
  46. }
  47. private com.google.protobuf.ByteString getValueNameBytes() {
  48. java.lang.Object ref = valueName_;
  49. if (ref instanceof String) {
  50. com.google.protobuf.ByteString b =
  51. com.google.protobuf.ByteString.copyFromUtf8((String) ref);
  52. valueName_ = b;
  53. return b;
  54. } else {
  55. return (com.google.protobuf.ByteString) ref;
  56. }
  57. }
  58. // required string value = 2;
  59. public static final int VALUE_FIELD_NUMBER = 2;
  60. private java.lang.Object value_;
  61. public boolean hasValue() {
  62. return ((bitField0_ & 0x00000002) == 0x00000002);
  63. }
  64. public String getValue() {
  65. java.lang.Object ref = value_;
  66. if (ref instanceof String) {
  67. return (String) ref;
  68. } else {
  69. com.google.protobuf.ByteString bs =
  70. (com.google.protobuf.ByteString) ref;
  71. String s = bs.toStringUtf8();
  72. if (com.google.protobuf.Internal.isValidUtf8(bs)) {
  73. value_ = s;
  74. }
  75. return s;
  76. }
  77. }
  78. private com.google.protobuf.ByteString getValueBytes() {
  79. java.lang.Object ref = value_;
  80. if (ref instanceof String) {
  81. com.google.protobuf.ByteString b =
  82. com.google.protobuf.ByteString.copyFromUtf8((String) ref);
  83. value_ = b;
  84. return b;
  85. } else {
  86. return (com.google.protobuf.ByteString) ref;
  87. }
  88. }
  89. private void initFields() {
  90. valueName_ = "";
  91. value_ = "";
  92. }
  93. private byte memoizedIsInitialized = -1;
  94. public final boolean isInitialized() {
  95. byte isInitialized = memoizedIsInitialized;
  96. if (isInitialized != -1) return isInitialized == 1;
  97. if (!hasValueName()) {
  98. memoizedIsInitialized = 0;
  99. return false;
  100. }
  101. if (!hasValue()) {
  102. memoizedIsInitialized = 0;
  103. return false;
  104. }
  105. memoizedIsInitialized = 1;
  106. return true;
  107. }
  108. public void writeTo(com.google.protobuf.CodedOutputStream output)
  109. throws java.io.IOException {
  110. getSerializedSize();
  111. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  112. output.writeBytes(1, getValueNameBytes());
  113. }
  114. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  115. output.writeBytes(2, getValueBytes());
  116. }
  117. getUnknownFields().writeTo(output);
  118. }
  119. private int memoizedSerializedSize = -1;
  120. public int getSerializedSize() {
  121. int size = memoizedSerializedSize;
  122. if (size != -1) return size;
  123. size = 0;
  124. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  125. size += com.google.protobuf.CodedOutputStream
  126. .computeBytesSize(1, getValueNameBytes());
  127. }
  128. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  129. size += com.google.protobuf.CodedOutputStream
  130. .computeBytesSize(2, getValueBytes());
  131. }
  132. size += getUnknownFields().getSerializedSize();
  133. memoizedSerializedSize = size;
  134. return size;
  135. }
  136. private static final long serialVersionUID = 0L;
  137. @java.lang.Override
  138. protected java.lang.Object writeReplace()
  139. throws java.io.ObjectStreamException {
  140. return super.writeReplace();
  141. }
  142. @java.lang.Override
  143. public boolean equals(final java.lang.Object obj) {
  144. if (obj == this) {
  145. return true;
  146. }
  147. if (!(obj instanceof com.google.publicalerts.cap.ValuePair)) {
  148. return super.equals(obj);
  149. }
  150. com.google.publicalerts.cap.ValuePair other = (com.google.publicalerts.cap.ValuePair) obj;
  151. boolean result = true;
  152. result = result && (hasValueName() == other.hasValueName());
  153. if (hasValueName()) {
  154. result = result && getValueName()
  155. .equals(other.getValueName());
  156. }
  157. result = result && (hasValue() == other.hasValue());
  158. if (hasValue()) {
  159. result = result && getValue()
  160. .equals(other.getValue());
  161. }
  162. result = result &&
  163. getUnknownFields().equals(other.getUnknownFields());
  164. return result;
  165. }
  166. @java.lang.Override
  167. public int hashCode() {
  168. int hash = 41;
  169. hash = (19 * hash) + getDescriptorForType().hashCode();
  170. if (hasValueName()) {
  171. hash = (37 * hash) + VALUE_NAME_FIELD_NUMBER;
  172. hash = (53 * hash) + getValueName().hashCode();
  173. }
  174. if (hasValue()) {
  175. hash = (37 * hash) + VALUE_FIELD_NUMBER;
  176. hash = (53 * hash) + getValue().hashCode();
  177. }
  178. hash = (29 * hash) + getUnknownFields().hashCode();
  179. return hash;
  180. }
  181. public static com.google.publicalerts.cap.ValuePair parseFrom(
  182. com.google.protobuf.ByteString data)
  183. throws com.google.protobuf.InvalidProtocolBufferException {
  184. return newBuilder().mergeFrom(data).buildParsed();
  185. }
  186. public static com.google.publicalerts.cap.ValuePair parseFrom(
  187. com.google.protobuf.ByteString data,
  188. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  189. throws com.google.protobuf.InvalidProtocolBufferException {
  190. return newBuilder().mergeFrom(data, extensionRegistry)
  191. .buildParsed();
  192. }
  193. public static com.google.publicalerts.cap.ValuePair parseFrom(byte[] data)
  194. throws com.google.protobuf.InvalidProtocolBufferException {
  195. return newBuilder().mergeFrom(data).buildParsed();
  196. }
  197. public static com.google.publicalerts.cap.ValuePair parseFrom(
  198. byte[] data,
  199. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  200. throws com.google.protobuf.InvalidProtocolBufferException {
  201. return newBuilder().mergeFrom(data, extensionRegistry)
  202. .buildParsed();
  203. }
  204. public static com.google.publicalerts.cap.ValuePair parseFrom(java.io.InputStream input)
  205. throws java.io.IOException {
  206. return newBuilder().mergeFrom(input).buildParsed();
  207. }
  208. public static com.google.publicalerts.cap.ValuePair parseFrom(
  209. java.io.InputStream input,
  210. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  211. throws java.io.IOException {
  212. return newBuilder().mergeFrom(input, extensionRegistry)
  213. .buildParsed();
  214. }
  215. public static com.google.publicalerts.cap.ValuePair parseDelimitedFrom(java.io.InputStream input)
  216. throws java.io.IOException {
  217. Builder builder = newBuilder();
  218. if (builder.mergeDelimitedFrom(input)) {
  219. return builder.buildParsed();
  220. } else {
  221. return null;
  222. }
  223. }
  224. public static com.google.publicalerts.cap.ValuePair parseDelimitedFrom(
  225. java.io.InputStream input,
  226. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  227. throws java.io.IOException {
  228. Builder builder = newBuilder();
  229. if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
  230. return builder.buildParsed();
  231. } else {
  232. return null;
  233. }
  234. }
  235. public static com.google.publicalerts.cap.ValuePair parseFrom(
  236. com.google.protobuf.CodedInputStream input)
  237. throws java.io.IOException {
  238. return newBuilder().mergeFrom(input).buildParsed();
  239. }
  240. public static com.google.publicalerts.cap.ValuePair parseFrom(
  241. com.google.protobuf.CodedInputStream input,
  242. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  243. throws java.io.IOException {
  244. return newBuilder().mergeFrom(input, extensionRegistry)
  245. .buildParsed();
  246. }
  247. public static Builder newBuilder() { return Builder.create(); }
  248. public Builder newBuilderForType() { return newBuilder(); }
  249. public static Builder newBuilder(com.google.publicalerts.cap.ValuePair prototype) {
  250. return newBuilder().mergeFrom(prototype);
  251. }
  252. public Builder toBuilder() { return newBuilder(this); }
  253. @java.lang.Override
  254. protected Builder newBuilderForType(
  255. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  256. Builder builder = new Builder(parent);
  257. return builder;
  258. }
  259. public static final class Builder extends
  260. com.google.protobuf.GeneratedMessage.Builder<Builder>
  261. implements com.google.publicalerts.cap.ValuePairOrBuilder {
  262. public static final com.google.protobuf.Descriptors.Descriptor
  263. getDescriptor() {
  264. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_ValuePair_descriptor;
  265. }
  266. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  267. internalGetFieldAccessorTable() {
  268. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_ValuePair_fieldAccessorTable;
  269. }
  270. // Construct using com.google.publicalerts.cap.ValuePair.newBuilder()
  271. private Builder() {
  272. maybeForceBuilderInitialization();
  273. }
  274. private Builder(BuilderParent parent) {
  275. super(parent);
  276. maybeForceBuilderInitialization();
  277. }
  278. private void maybeForceBuilderInitialization() {
  279. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  280. }
  281. }
  282. private static Builder create() {
  283. return new Builder();
  284. }
  285. public Builder clear() {
  286. super.clear();
  287. valueName_ = "";
  288. bitField0_ = (bitField0_ & ~0x00000001);
  289. value_ = "";
  290. bitField0_ = (bitField0_ & ~0x00000002);
  291. return this;
  292. }
  293. public Builder clone() {
  294. return create().mergeFrom(buildPartial());
  295. }
  296. public com.google.protobuf.Descriptors.Descriptor
  297. getDescriptorForType() {
  298. return com.google.publicalerts.cap.ValuePair.getDescriptor();
  299. }
  300. public com.google.publicalerts.cap.ValuePair getDefaultInstanceForType() {
  301. return com.google.publicalerts.cap.ValuePair.getDefaultInstance();
  302. }
  303. public com.google.publicalerts.cap.ValuePair build() {
  304. com.google.publicalerts.cap.ValuePair result = buildPartial();
  305. if (!result.isInitialized()) {
  306. throw newUninitializedMessageException(result);
  307. }
  308. return result;
  309. }
  310. private com.google.publicalerts.cap.ValuePair buildParsed()
  311. throws com.google.protobuf.InvalidProtocolBufferException {
  312. com.google.publicalerts.cap.ValuePair result = buildPartial();
  313. if (!result.isInitialized()) {
  314. throw newUninitializedMessageException(
  315. result).asInvalidProtocolBufferException();
  316. }
  317. return result;
  318. }
  319. public com.google.publicalerts.cap.ValuePair buildPartial() {
  320. com.google.publicalerts.cap.ValuePair result = new com.google.publicalerts.cap.ValuePair(this);
  321. int from_bitField0_ = bitField0_;
  322. int to_bitField0_ = 0;
  323. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  324. to_bitField0_ |= 0x00000001;
  325. }
  326. result.valueName_ = valueName_;
  327. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  328. to_bitField0_ |= 0x00000002;
  329. }
  330. result.value_ = value_;
  331. result.bitField0_ = to_bitField0_;
  332. onBuilt();
  333. return result;
  334. }
  335. public Builder mergeFrom(com.google.protobuf.Message other) {
  336. if (other instanceof com.google.publicalerts.cap.ValuePair) {
  337. return mergeFrom((com.google.publicalerts.cap.ValuePair)other);
  338. } else {
  339. super.mergeFrom(other);
  340. return this;
  341. }
  342. }
  343. public Builder mergeFrom(com.google.publicalerts.cap.ValuePair other) {
  344. if (other == com.google.publicalerts.cap.ValuePair.getDefaultInstance()) return this;
  345. if (other.hasValueName()) {
  346. setValueName(other.getValueName());
  347. }
  348. if (other.hasValue()) {
  349. setValue(other.getValue());
  350. }
  351. this.mergeUnknownFields(other.getUnknownFields());
  352. return this;
  353. }
  354. public final boolean isInitialized() {
  355. if (!hasValueName()) {
  356. return false;
  357. }
  358. if (!hasValue()) {
  359. return false;
  360. }
  361. return true;
  362. }
  363. public Builder mergeFrom(
  364. com.google.protobuf.CodedInputStream input,
  365. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  366. throws java.io.IOException {
  367. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  368. com.google.protobuf.UnknownFieldSet.newBuilder(
  369. this.getUnknownFields());
  370. while (true) {
  371. int tag = input.readTag();
  372. switch (tag) {
  373. case 0:
  374. this.setUnknownFields(unknownFields.build());
  375. onChanged();
  376. return this;
  377. default: {
  378. if (!parseUnknownField(input, unknownFields,
  379. extensionRegistry, tag)) {
  380. this.setUnknownFields(unknownFields.build());
  381. onChanged();
  382. return this;
  383. }
  384. break;
  385. }
  386. case 10: {
  387. bitField0_ |= 0x00000001;
  388. valueName_ = input.readBytes();
  389. break;
  390. }
  391. case 18: {
  392. bitField0_ |= 0x00000002;
  393. value_ = input.readBytes();
  394. break;
  395. }
  396. }
  397. }
  398. }
  399. private int bitField0_;
  400. // required string value_name = 1;
  401. private java.lang.Object valueName_ = "";
  402. public boolean hasValueName() {
  403. return ((bitField0_ & 0x00000001) == 0x00000001);
  404. }
  405. public String getValueName() {
  406. java.lang.Object ref = valueName_;
  407. if (!(ref instanceof String)) {
  408. String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
  409. valueName_ = s;
  410. return s;
  411. } else {
  412. return (String) ref;
  413. }
  414. }
  415. public Builder setValueName(String value) {
  416. if (value == null) {
  417. throw new NullPointerException();
  418. }
  419. bitField0_ |= 0x00000001;
  420. valueName_ = value;
  421. onChanged();
  422. return this;
  423. }
  424. public Builder clearValueName() {
  425. bitField0_ = (bitField0_ & ~0x00000001);
  426. valueName_ = getDefaultInstance().getValueName();
  427. onChanged();
  428. return this;
  429. }
  430. void setValueName(com.google.protobuf.ByteString value) {
  431. bitField0_ |= 0x00000001;
  432. valueName_ = value;
  433. onChanged();
  434. }
  435. // required string value = 2;
  436. private java.lang.Object value_ = "";
  437. public boolean hasValue() {
  438. return ((bitField0_ & 0x00000002) == 0x00000002);
  439. }
  440. public String getValue() {
  441. java.lang.Object ref = value_;
  442. if (!(ref instanceof String)) {
  443. String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
  444. value_ = s;
  445. return s;
  446. } else {
  447. return (String) ref;
  448. }
  449. }
  450. public Builder setValue(String value) {
  451. if (value == null) {
  452. throw new NullPointerException();
  453. }
  454. bitField0_ |= 0x00000002;
  455. value_ = value;
  456. onChanged();
  457. return this;
  458. }
  459. public Builder clearValue() {
  460. bitField0_ = (bitField0_ & ~0x00000002);
  461. value_ = getDefaultInstance().getValue();
  462. onChanged();
  463. return this;
  464. }
  465. void setValue(com.google.protobuf.ByteString value) {
  466. bitField0_ |= 0x00000002;
  467. value_ = value;
  468. onChanged();
  469. }
  470. // @@protoc_insertion_point(builder_scope:publicalerts.cap.ValuePair)
  471. }
  472. static {
  473. defaultInstance = new ValuePair(true);
  474. defaultInstance.initFields();
  475. }
  476. // @@protoc_insertion_point(class_scope:publicalerts.cap.ValuePair)
  477. }