PageRenderTime 51ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 1ms

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

https://code.google.com/p/cap-library/
Java | 871 lines | 804 code | 50 blank | 17 comment | 154 complexity | 163b53668e2be41988000349e1f3fd34 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 Resource extends
  4. com.google.protobuf.GeneratedMessage
  5. implements ResourceOrBuilder {
  6. // Use Resource.newBuilder() to construct.
  7. private Resource(Builder builder) {
  8. super(builder);
  9. }
  10. private Resource(boolean noInit) {}
  11. private static final Resource defaultInstance;
  12. public static Resource getDefaultInstance() {
  13. return defaultInstance;
  14. }
  15. public Resource 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_Resource_descriptor;
  21. }
  22. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  23. internalGetFieldAccessorTable() {
  24. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Resource_fieldAccessorTable;
  25. }
  26. private int bitField0_;
  27. // required string resource_desc = 1;
  28. public static final int RESOURCE_DESC_FIELD_NUMBER = 1;
  29. private java.lang.Object resourceDesc_;
  30. public boolean hasResourceDesc() {
  31. return ((bitField0_ & 0x00000001) == 0x00000001);
  32. }
  33. public String getResourceDesc() {
  34. java.lang.Object ref = resourceDesc_;
  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. resourceDesc_ = s;
  43. }
  44. return s;
  45. }
  46. }
  47. private com.google.protobuf.ByteString getResourceDescBytes() {
  48. java.lang.Object ref = resourceDesc_;
  49. if (ref instanceof String) {
  50. com.google.protobuf.ByteString b =
  51. com.google.protobuf.ByteString.copyFromUtf8((String) ref);
  52. resourceDesc_ = b;
  53. return b;
  54. } else {
  55. return (com.google.protobuf.ByteString) ref;
  56. }
  57. }
  58. // optional string mime_type = 2;
  59. public static final int MIME_TYPE_FIELD_NUMBER = 2;
  60. private java.lang.Object mimeType_;
  61. public boolean hasMimeType() {
  62. return ((bitField0_ & 0x00000002) == 0x00000002);
  63. }
  64. public String getMimeType() {
  65. java.lang.Object ref = mimeType_;
  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. mimeType_ = s;
  74. }
  75. return s;
  76. }
  77. }
  78. private com.google.protobuf.ByteString getMimeTypeBytes() {
  79. java.lang.Object ref = mimeType_;
  80. if (ref instanceof String) {
  81. com.google.protobuf.ByteString b =
  82. com.google.protobuf.ByteString.copyFromUtf8((String) ref);
  83. mimeType_ = b;
  84. return b;
  85. } else {
  86. return (com.google.protobuf.ByteString) ref;
  87. }
  88. }
  89. // optional int64 size = 3;
  90. public static final int SIZE_FIELD_NUMBER = 3;
  91. private long size_;
  92. public boolean hasSize() {
  93. return ((bitField0_ & 0x00000004) == 0x00000004);
  94. }
  95. public long getSize() {
  96. return size_;
  97. }
  98. // optional string uri = 4;
  99. public static final int URI_FIELD_NUMBER = 4;
  100. private java.lang.Object uri_;
  101. public boolean hasUri() {
  102. return ((bitField0_ & 0x00000008) == 0x00000008);
  103. }
  104. public String getUri() {
  105. java.lang.Object ref = uri_;
  106. if (ref instanceof String) {
  107. return (String) ref;
  108. } else {
  109. com.google.protobuf.ByteString bs =
  110. (com.google.protobuf.ByteString) ref;
  111. String s = bs.toStringUtf8();
  112. if (com.google.protobuf.Internal.isValidUtf8(bs)) {
  113. uri_ = s;
  114. }
  115. return s;
  116. }
  117. }
  118. private com.google.protobuf.ByteString getUriBytes() {
  119. java.lang.Object ref = uri_;
  120. if (ref instanceof String) {
  121. com.google.protobuf.ByteString b =
  122. com.google.protobuf.ByteString.copyFromUtf8((String) ref);
  123. uri_ = b;
  124. return b;
  125. } else {
  126. return (com.google.protobuf.ByteString) ref;
  127. }
  128. }
  129. // optional string deref_uri = 5;
  130. public static final int DEREF_URI_FIELD_NUMBER = 5;
  131. private java.lang.Object derefUri_;
  132. public boolean hasDerefUri() {
  133. return ((bitField0_ & 0x00000010) == 0x00000010);
  134. }
  135. public String getDerefUri() {
  136. java.lang.Object ref = derefUri_;
  137. if (ref instanceof String) {
  138. return (String) ref;
  139. } else {
  140. com.google.protobuf.ByteString bs =
  141. (com.google.protobuf.ByteString) ref;
  142. String s = bs.toStringUtf8();
  143. if (com.google.protobuf.Internal.isValidUtf8(bs)) {
  144. derefUri_ = s;
  145. }
  146. return s;
  147. }
  148. }
  149. private com.google.protobuf.ByteString getDerefUriBytes() {
  150. java.lang.Object ref = derefUri_;
  151. if (ref instanceof String) {
  152. com.google.protobuf.ByteString b =
  153. com.google.protobuf.ByteString.copyFromUtf8((String) ref);
  154. derefUri_ = b;
  155. return b;
  156. } else {
  157. return (com.google.protobuf.ByteString) ref;
  158. }
  159. }
  160. // optional string digest = 6;
  161. public static final int DIGEST_FIELD_NUMBER = 6;
  162. private java.lang.Object digest_;
  163. public boolean hasDigest() {
  164. return ((bitField0_ & 0x00000020) == 0x00000020);
  165. }
  166. public String getDigest() {
  167. java.lang.Object ref = digest_;
  168. if (ref instanceof String) {
  169. return (String) ref;
  170. } else {
  171. com.google.protobuf.ByteString bs =
  172. (com.google.protobuf.ByteString) ref;
  173. String s = bs.toStringUtf8();
  174. if (com.google.protobuf.Internal.isValidUtf8(bs)) {
  175. digest_ = s;
  176. }
  177. return s;
  178. }
  179. }
  180. private com.google.protobuf.ByteString getDigestBytes() {
  181. java.lang.Object ref = digest_;
  182. if (ref instanceof String) {
  183. com.google.protobuf.ByteString b =
  184. com.google.protobuf.ByteString.copyFromUtf8((String) ref);
  185. digest_ = b;
  186. return b;
  187. } else {
  188. return (com.google.protobuf.ByteString) ref;
  189. }
  190. }
  191. private void initFields() {
  192. resourceDesc_ = "";
  193. mimeType_ = "";
  194. size_ = 0L;
  195. uri_ = "";
  196. derefUri_ = "";
  197. digest_ = "";
  198. }
  199. private byte memoizedIsInitialized = -1;
  200. public final boolean isInitialized() {
  201. byte isInitialized = memoizedIsInitialized;
  202. if (isInitialized != -1) return isInitialized == 1;
  203. if (!hasResourceDesc()) {
  204. memoizedIsInitialized = 0;
  205. return false;
  206. }
  207. memoizedIsInitialized = 1;
  208. return true;
  209. }
  210. public void writeTo(com.google.protobuf.CodedOutputStream output)
  211. throws java.io.IOException {
  212. getSerializedSize();
  213. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  214. output.writeBytes(1, getResourceDescBytes());
  215. }
  216. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  217. output.writeBytes(2, getMimeTypeBytes());
  218. }
  219. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  220. output.writeInt64(3, size_);
  221. }
  222. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  223. output.writeBytes(4, getUriBytes());
  224. }
  225. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  226. output.writeBytes(5, getDerefUriBytes());
  227. }
  228. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  229. output.writeBytes(6, getDigestBytes());
  230. }
  231. getUnknownFields().writeTo(output);
  232. }
  233. private int memoizedSerializedSize = -1;
  234. public int getSerializedSize() {
  235. int size = memoizedSerializedSize;
  236. if (size != -1) return size;
  237. size = 0;
  238. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  239. size += com.google.protobuf.CodedOutputStream
  240. .computeBytesSize(1, getResourceDescBytes());
  241. }
  242. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  243. size += com.google.protobuf.CodedOutputStream
  244. .computeBytesSize(2, getMimeTypeBytes());
  245. }
  246. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  247. size += com.google.protobuf.CodedOutputStream
  248. .computeInt64Size(3, size_);
  249. }
  250. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  251. size += com.google.protobuf.CodedOutputStream
  252. .computeBytesSize(4, getUriBytes());
  253. }
  254. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  255. size += com.google.protobuf.CodedOutputStream
  256. .computeBytesSize(5, getDerefUriBytes());
  257. }
  258. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  259. size += com.google.protobuf.CodedOutputStream
  260. .computeBytesSize(6, getDigestBytes());
  261. }
  262. size += getUnknownFields().getSerializedSize();
  263. memoizedSerializedSize = size;
  264. return size;
  265. }
  266. private static final long serialVersionUID = 0L;
  267. @java.lang.Override
  268. protected java.lang.Object writeReplace()
  269. throws java.io.ObjectStreamException {
  270. return super.writeReplace();
  271. }
  272. @java.lang.Override
  273. public boolean equals(final java.lang.Object obj) {
  274. if (obj == this) {
  275. return true;
  276. }
  277. if (!(obj instanceof com.google.publicalerts.cap.Resource)) {
  278. return super.equals(obj);
  279. }
  280. com.google.publicalerts.cap.Resource other = (com.google.publicalerts.cap.Resource) obj;
  281. boolean result = true;
  282. result = result && (hasResourceDesc() == other.hasResourceDesc());
  283. if (hasResourceDesc()) {
  284. result = result && getResourceDesc()
  285. .equals(other.getResourceDesc());
  286. }
  287. result = result && (hasMimeType() == other.hasMimeType());
  288. if (hasMimeType()) {
  289. result = result && getMimeType()
  290. .equals(other.getMimeType());
  291. }
  292. result = result && (hasSize() == other.hasSize());
  293. if (hasSize()) {
  294. result = result && (getSize()
  295. == other.getSize());
  296. }
  297. result = result && (hasUri() == other.hasUri());
  298. if (hasUri()) {
  299. result = result && getUri()
  300. .equals(other.getUri());
  301. }
  302. result = result && (hasDerefUri() == other.hasDerefUri());
  303. if (hasDerefUri()) {
  304. result = result && getDerefUri()
  305. .equals(other.getDerefUri());
  306. }
  307. result = result && (hasDigest() == other.hasDigest());
  308. if (hasDigest()) {
  309. result = result && getDigest()
  310. .equals(other.getDigest());
  311. }
  312. result = result &&
  313. getUnknownFields().equals(other.getUnknownFields());
  314. return result;
  315. }
  316. @java.lang.Override
  317. public int hashCode() {
  318. int hash = 41;
  319. hash = (19 * hash) + getDescriptorForType().hashCode();
  320. if (hasResourceDesc()) {
  321. hash = (37 * hash) + RESOURCE_DESC_FIELD_NUMBER;
  322. hash = (53 * hash) + getResourceDesc().hashCode();
  323. }
  324. if (hasMimeType()) {
  325. hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER;
  326. hash = (53 * hash) + getMimeType().hashCode();
  327. }
  328. if (hasSize()) {
  329. hash = (37 * hash) + SIZE_FIELD_NUMBER;
  330. hash = (53 * hash) + hashLong(getSize());
  331. }
  332. if (hasUri()) {
  333. hash = (37 * hash) + URI_FIELD_NUMBER;
  334. hash = (53 * hash) + getUri().hashCode();
  335. }
  336. if (hasDerefUri()) {
  337. hash = (37 * hash) + DEREF_URI_FIELD_NUMBER;
  338. hash = (53 * hash) + getDerefUri().hashCode();
  339. }
  340. if (hasDigest()) {
  341. hash = (37 * hash) + DIGEST_FIELD_NUMBER;
  342. hash = (53 * hash) + getDigest().hashCode();
  343. }
  344. hash = (29 * hash) + getUnknownFields().hashCode();
  345. return hash;
  346. }
  347. public static com.google.publicalerts.cap.Resource parseFrom(
  348. com.google.protobuf.ByteString data)
  349. throws com.google.protobuf.InvalidProtocolBufferException {
  350. return newBuilder().mergeFrom(data).buildParsed();
  351. }
  352. public static com.google.publicalerts.cap.Resource parseFrom(
  353. com.google.protobuf.ByteString data,
  354. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  355. throws com.google.protobuf.InvalidProtocolBufferException {
  356. return newBuilder().mergeFrom(data, extensionRegistry)
  357. .buildParsed();
  358. }
  359. public static com.google.publicalerts.cap.Resource parseFrom(byte[] data)
  360. throws com.google.protobuf.InvalidProtocolBufferException {
  361. return newBuilder().mergeFrom(data).buildParsed();
  362. }
  363. public static com.google.publicalerts.cap.Resource parseFrom(
  364. byte[] data,
  365. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  366. throws com.google.protobuf.InvalidProtocolBufferException {
  367. return newBuilder().mergeFrom(data, extensionRegistry)
  368. .buildParsed();
  369. }
  370. public static com.google.publicalerts.cap.Resource parseFrom(java.io.InputStream input)
  371. throws java.io.IOException {
  372. return newBuilder().mergeFrom(input).buildParsed();
  373. }
  374. public static com.google.publicalerts.cap.Resource parseFrom(
  375. java.io.InputStream input,
  376. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  377. throws java.io.IOException {
  378. return newBuilder().mergeFrom(input, extensionRegistry)
  379. .buildParsed();
  380. }
  381. public static com.google.publicalerts.cap.Resource parseDelimitedFrom(java.io.InputStream input)
  382. throws java.io.IOException {
  383. Builder builder = newBuilder();
  384. if (builder.mergeDelimitedFrom(input)) {
  385. return builder.buildParsed();
  386. } else {
  387. return null;
  388. }
  389. }
  390. public static com.google.publicalerts.cap.Resource parseDelimitedFrom(
  391. java.io.InputStream input,
  392. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  393. throws java.io.IOException {
  394. Builder builder = newBuilder();
  395. if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
  396. return builder.buildParsed();
  397. } else {
  398. return null;
  399. }
  400. }
  401. public static com.google.publicalerts.cap.Resource parseFrom(
  402. com.google.protobuf.CodedInputStream input)
  403. throws java.io.IOException {
  404. return newBuilder().mergeFrom(input).buildParsed();
  405. }
  406. public static com.google.publicalerts.cap.Resource parseFrom(
  407. com.google.protobuf.CodedInputStream input,
  408. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  409. throws java.io.IOException {
  410. return newBuilder().mergeFrom(input, extensionRegistry)
  411. .buildParsed();
  412. }
  413. public static Builder newBuilder() { return Builder.create(); }
  414. public Builder newBuilderForType() { return newBuilder(); }
  415. public static Builder newBuilder(com.google.publicalerts.cap.Resource prototype) {
  416. return newBuilder().mergeFrom(prototype);
  417. }
  418. public Builder toBuilder() { return newBuilder(this); }
  419. @java.lang.Override
  420. protected Builder newBuilderForType(
  421. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  422. Builder builder = new Builder(parent);
  423. return builder;
  424. }
  425. public static final class Builder extends
  426. com.google.protobuf.GeneratedMessage.Builder<Builder>
  427. implements com.google.publicalerts.cap.ResourceOrBuilder {
  428. public static final com.google.protobuf.Descriptors.Descriptor
  429. getDescriptor() {
  430. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Resource_descriptor;
  431. }
  432. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  433. internalGetFieldAccessorTable() {
  434. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Resource_fieldAccessorTable;
  435. }
  436. // Construct using com.google.publicalerts.cap.Resource.newBuilder()
  437. private Builder() {
  438. maybeForceBuilderInitialization();
  439. }
  440. private Builder(BuilderParent parent) {
  441. super(parent);
  442. maybeForceBuilderInitialization();
  443. }
  444. private void maybeForceBuilderInitialization() {
  445. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  446. }
  447. }
  448. private static Builder create() {
  449. return new Builder();
  450. }
  451. public Builder clear() {
  452. super.clear();
  453. resourceDesc_ = "";
  454. bitField0_ = (bitField0_ & ~0x00000001);
  455. mimeType_ = "";
  456. bitField0_ = (bitField0_ & ~0x00000002);
  457. size_ = 0L;
  458. bitField0_ = (bitField0_ & ~0x00000004);
  459. uri_ = "";
  460. bitField0_ = (bitField0_ & ~0x00000008);
  461. derefUri_ = "";
  462. bitField0_ = (bitField0_ & ~0x00000010);
  463. digest_ = "";
  464. bitField0_ = (bitField0_ & ~0x00000020);
  465. return this;
  466. }
  467. public Builder clone() {
  468. return create().mergeFrom(buildPartial());
  469. }
  470. public com.google.protobuf.Descriptors.Descriptor
  471. getDescriptorForType() {
  472. return com.google.publicalerts.cap.Resource.getDescriptor();
  473. }
  474. public com.google.publicalerts.cap.Resource getDefaultInstanceForType() {
  475. return com.google.publicalerts.cap.Resource.getDefaultInstance();
  476. }
  477. public com.google.publicalerts.cap.Resource build() {
  478. com.google.publicalerts.cap.Resource result = buildPartial();
  479. if (!result.isInitialized()) {
  480. throw newUninitializedMessageException(result);
  481. }
  482. return result;
  483. }
  484. private com.google.publicalerts.cap.Resource buildParsed()
  485. throws com.google.protobuf.InvalidProtocolBufferException {
  486. com.google.publicalerts.cap.Resource result = buildPartial();
  487. if (!result.isInitialized()) {
  488. throw newUninitializedMessageException(
  489. result).asInvalidProtocolBufferException();
  490. }
  491. return result;
  492. }
  493. public com.google.publicalerts.cap.Resource buildPartial() {
  494. com.google.publicalerts.cap.Resource result = new com.google.publicalerts.cap.Resource(this);
  495. int from_bitField0_ = bitField0_;
  496. int to_bitField0_ = 0;
  497. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  498. to_bitField0_ |= 0x00000001;
  499. }
  500. result.resourceDesc_ = resourceDesc_;
  501. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  502. to_bitField0_ |= 0x00000002;
  503. }
  504. result.mimeType_ = mimeType_;
  505. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  506. to_bitField0_ |= 0x00000004;
  507. }
  508. result.size_ = size_;
  509. if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
  510. to_bitField0_ |= 0x00000008;
  511. }
  512. result.uri_ = uri_;
  513. if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
  514. to_bitField0_ |= 0x00000010;
  515. }
  516. result.derefUri_ = derefUri_;
  517. if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
  518. to_bitField0_ |= 0x00000020;
  519. }
  520. result.digest_ = digest_;
  521. result.bitField0_ = to_bitField0_;
  522. onBuilt();
  523. return result;
  524. }
  525. public Builder mergeFrom(com.google.protobuf.Message other) {
  526. if (other instanceof com.google.publicalerts.cap.Resource) {
  527. return mergeFrom((com.google.publicalerts.cap.Resource)other);
  528. } else {
  529. super.mergeFrom(other);
  530. return this;
  531. }
  532. }
  533. public Builder mergeFrom(com.google.publicalerts.cap.Resource other) {
  534. if (other == com.google.publicalerts.cap.Resource.getDefaultInstance()) return this;
  535. if (other.hasResourceDesc()) {
  536. setResourceDesc(other.getResourceDesc());
  537. }
  538. if (other.hasMimeType()) {
  539. setMimeType(other.getMimeType());
  540. }
  541. if (other.hasSize()) {
  542. setSize(other.getSize());
  543. }
  544. if (other.hasUri()) {
  545. setUri(other.getUri());
  546. }
  547. if (other.hasDerefUri()) {
  548. setDerefUri(other.getDerefUri());
  549. }
  550. if (other.hasDigest()) {
  551. setDigest(other.getDigest());
  552. }
  553. this.mergeUnknownFields(other.getUnknownFields());
  554. return this;
  555. }
  556. public final boolean isInitialized() {
  557. if (!hasResourceDesc()) {
  558. return false;
  559. }
  560. return true;
  561. }
  562. public Builder mergeFrom(
  563. com.google.protobuf.CodedInputStream input,
  564. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  565. throws java.io.IOException {
  566. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  567. com.google.protobuf.UnknownFieldSet.newBuilder(
  568. this.getUnknownFields());
  569. while (true) {
  570. int tag = input.readTag();
  571. switch (tag) {
  572. case 0:
  573. this.setUnknownFields(unknownFields.build());
  574. onChanged();
  575. return this;
  576. default: {
  577. if (!parseUnknownField(input, unknownFields,
  578. extensionRegistry, tag)) {
  579. this.setUnknownFields(unknownFields.build());
  580. onChanged();
  581. return this;
  582. }
  583. break;
  584. }
  585. case 10: {
  586. bitField0_ |= 0x00000001;
  587. resourceDesc_ = input.readBytes();
  588. break;
  589. }
  590. case 18: {
  591. bitField0_ |= 0x00000002;
  592. mimeType_ = input.readBytes();
  593. break;
  594. }
  595. case 24: {
  596. bitField0_ |= 0x00000004;
  597. size_ = input.readInt64();
  598. break;
  599. }
  600. case 34: {
  601. bitField0_ |= 0x00000008;
  602. uri_ = input.readBytes();
  603. break;
  604. }
  605. case 42: {
  606. bitField0_ |= 0x00000010;
  607. derefUri_ = input.readBytes();
  608. break;
  609. }
  610. case 50: {
  611. bitField0_ |= 0x00000020;
  612. digest_ = input.readBytes();
  613. break;
  614. }
  615. }
  616. }
  617. }
  618. private int bitField0_;
  619. // required string resource_desc = 1;
  620. private java.lang.Object resourceDesc_ = "";
  621. public boolean hasResourceDesc() {
  622. return ((bitField0_ & 0x00000001) == 0x00000001);
  623. }
  624. public String getResourceDesc() {
  625. java.lang.Object ref = resourceDesc_;
  626. if (!(ref instanceof String)) {
  627. String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
  628. resourceDesc_ = s;
  629. return s;
  630. } else {
  631. return (String) ref;
  632. }
  633. }
  634. public Builder setResourceDesc(String value) {
  635. if (value == null) {
  636. throw new NullPointerException();
  637. }
  638. bitField0_ |= 0x00000001;
  639. resourceDesc_ = value;
  640. onChanged();
  641. return this;
  642. }
  643. public Builder clearResourceDesc() {
  644. bitField0_ = (bitField0_ & ~0x00000001);
  645. resourceDesc_ = getDefaultInstance().getResourceDesc();
  646. onChanged();
  647. return this;
  648. }
  649. void setResourceDesc(com.google.protobuf.ByteString value) {
  650. bitField0_ |= 0x00000001;
  651. resourceDesc_ = value;
  652. onChanged();
  653. }
  654. // optional string mime_type = 2;
  655. private java.lang.Object mimeType_ = "";
  656. public boolean hasMimeType() {
  657. return ((bitField0_ & 0x00000002) == 0x00000002);
  658. }
  659. public String getMimeType() {
  660. java.lang.Object ref = mimeType_;
  661. if (!(ref instanceof String)) {
  662. String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
  663. mimeType_ = s;
  664. return s;
  665. } else {
  666. return (String) ref;
  667. }
  668. }
  669. public Builder setMimeType(String value) {
  670. if (value == null) {
  671. throw new NullPointerException();
  672. }
  673. bitField0_ |= 0x00000002;
  674. mimeType_ = value;
  675. onChanged();
  676. return this;
  677. }
  678. public Builder clearMimeType() {
  679. bitField0_ = (bitField0_ & ~0x00000002);
  680. mimeType_ = getDefaultInstance().getMimeType();
  681. onChanged();
  682. return this;
  683. }
  684. void setMimeType(com.google.protobuf.ByteString value) {
  685. bitField0_ |= 0x00000002;
  686. mimeType_ = value;
  687. onChanged();
  688. }
  689. // optional int64 size = 3;
  690. private long size_ ;
  691. public boolean hasSize() {
  692. return ((bitField0_ & 0x00000004) == 0x00000004);
  693. }
  694. public long getSize() {
  695. return size_;
  696. }
  697. public Builder setSize(long value) {
  698. bitField0_ |= 0x00000004;
  699. size_ = value;
  700. onChanged();
  701. return this;
  702. }
  703. public Builder clearSize() {
  704. bitField0_ = (bitField0_ & ~0x00000004);
  705. size_ = 0L;
  706. onChanged();
  707. return this;
  708. }
  709. // optional string uri = 4;
  710. private java.lang.Object uri_ = "";
  711. public boolean hasUri() {
  712. return ((bitField0_ & 0x00000008) == 0x00000008);
  713. }
  714. public String getUri() {
  715. java.lang.Object ref = uri_;
  716. if (!(ref instanceof String)) {
  717. String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
  718. uri_ = s;
  719. return s;
  720. } else {
  721. return (String) ref;
  722. }
  723. }
  724. public Builder setUri(String value) {
  725. if (value == null) {
  726. throw new NullPointerException();
  727. }
  728. bitField0_ |= 0x00000008;
  729. uri_ = value;
  730. onChanged();
  731. return this;
  732. }
  733. public Builder clearUri() {
  734. bitField0_ = (bitField0_ & ~0x00000008);
  735. uri_ = getDefaultInstance().getUri();
  736. onChanged();
  737. return this;
  738. }
  739. void setUri(com.google.protobuf.ByteString value) {
  740. bitField0_ |= 0x00000008;
  741. uri_ = value;
  742. onChanged();
  743. }
  744. // optional string deref_uri = 5;
  745. private java.lang.Object derefUri_ = "";
  746. public boolean hasDerefUri() {
  747. return ((bitField0_ & 0x00000010) == 0x00000010);
  748. }
  749. public String getDerefUri() {
  750. java.lang.Object ref = derefUri_;
  751. if (!(ref instanceof String)) {
  752. String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
  753. derefUri_ = s;
  754. return s;
  755. } else {
  756. return (String) ref;
  757. }
  758. }
  759. public Builder setDerefUri(String value) {
  760. if (value == null) {
  761. throw new NullPointerException();
  762. }
  763. bitField0_ |= 0x00000010;
  764. derefUri_ = value;
  765. onChanged();
  766. return this;
  767. }
  768. public Builder clearDerefUri() {
  769. bitField0_ = (bitField0_ & ~0x00000010);
  770. derefUri_ = getDefaultInstance().getDerefUri();
  771. onChanged();
  772. return this;
  773. }
  774. void setDerefUri(com.google.protobuf.ByteString value) {
  775. bitField0_ |= 0x00000010;
  776. derefUri_ = value;
  777. onChanged();
  778. }
  779. // optional string digest = 6;
  780. private java.lang.Object digest_ = "";
  781. public boolean hasDigest() {
  782. return ((bitField0_ & 0x00000020) == 0x00000020);
  783. }
  784. public String getDigest() {
  785. java.lang.Object ref = digest_;
  786. if (!(ref instanceof String)) {
  787. String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
  788. digest_ = s;
  789. return s;
  790. } else {
  791. return (String) ref;
  792. }
  793. }
  794. public Builder setDigest(String value) {
  795. if (value == null) {
  796. throw new NullPointerException();
  797. }
  798. bitField0_ |= 0x00000020;
  799. digest_ = value;
  800. onChanged();
  801. return this;
  802. }
  803. public Builder clearDigest() {
  804. bitField0_ = (bitField0_ & ~0x00000020);
  805. digest_ = getDefaultInstance().getDigest();
  806. onChanged();
  807. return this;
  808. }
  809. void setDigest(com.google.protobuf.ByteString value) {
  810. bitField0_ |= 0x00000020;
  811. digest_ = value;
  812. onChanged();
  813. }
  814. // @@protoc_insertion_point(builder_scope:publicalerts.cap.Resource)
  815. }
  816. static {
  817. defaultInstance = new Resource(true);
  818. defaultInstance.initFields();
  819. }
  820. // @@protoc_insertion_point(class_scope:publicalerts.cap.Resource)
  821. }