PageRenderTime 49ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/tpc/src/serializers/activemq/protobuf/MediaContentHolder.java

http://thrift-protobuf-compare.googlecode.com/
Java | 2053 lines | 1711 code | 287 blank | 55 comment | 245 complexity | 7fef92daa661fdeb7171202c1f28fbaf MD5 | raw file
  1. //
  2. // Generated by protoc, do not edit by hand.
  3. //
  4. package serializers.activemq.protobuf;
  5. public class MediaContentHolder {
  6. static public interface Image extends org.apache.activemq.protobuf.PBMessage<Image.ImageBean, Image.ImageBuffer> {
  7. public static enum Size {
  8. SMALL("SMALL", 0),
  9. LARGE("LARGE", 1);
  10. private final String name;
  11. private final int value;
  12. private Size(String name, int value) {
  13. this.name = name;
  14. this.value = value;
  15. }
  16. public final int getNumber() {
  17. return value;
  18. }
  19. public final String toString() {
  20. return name;
  21. }
  22. public static Size valueOf(int value) {
  23. switch (value) {
  24. case 0:
  25. return SMALL;
  26. case 1:
  27. return LARGE;
  28. default:
  29. return null;
  30. }
  31. }
  32. }
  33. // required string uri = 1;
  34. public boolean hasUri();
  35. public java.lang.String getUri();
  36. // optional string title = 2;
  37. public boolean hasTitle();
  38. public java.lang.String getTitle();
  39. // optional int32 width = 3;
  40. public boolean hasWidth();
  41. public int getWidth();
  42. // optional int32 height = 4;
  43. public boolean hasHeight();
  44. public int getHeight();
  45. // optional Size size = 5;
  46. public boolean hasSize();
  47. public Image.Size getSize();
  48. public ImageBean copy();
  49. public ImageBuffer freeze();
  50. public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix);
  51. static public final class ImageBean implements Image {
  52. ImageBuffer frozen;
  53. ImageBean bean;
  54. public ImageBean() {
  55. this.bean = this;
  56. }
  57. public ImageBean(ImageBean copy) {
  58. this.bean = copy;
  59. }
  60. public ImageBean copy() {
  61. return new ImageBean(bean);
  62. }
  63. public boolean frozen() {
  64. return frozen!=null;
  65. }
  66. public ImageBuffer freeze() {
  67. if( frozen==null ) {
  68. frozen = new ImageBuffer(bean);
  69. assert deepFreeze();
  70. }
  71. return frozen;
  72. }
  73. private boolean deepFreeze() {
  74. frozen.serializedSizeUnframed();
  75. return true;
  76. }
  77. private void copyCheck() {
  78. assert frozen==null : org.apache.activemq.protobuf.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
  79. if (bean != this) {
  80. copy(bean);
  81. }
  82. }
  83. private void copy(ImageBean other) {
  84. this.bean = this;
  85. this.f_uri = other.f_uri;
  86. this.b_uri = other.b_uri;
  87. this.f_title = other.f_title;
  88. this.b_title = other.b_title;
  89. this.f_width = other.f_width;
  90. this.b_width = other.b_width;
  91. this.f_height = other.f_height;
  92. this.b_height = other.b_height;
  93. this.f_size = other.f_size;
  94. this.b_size = other.b_size;
  95. }
  96. // required string uri = 1;
  97. private java.lang.String f_uri = null;
  98. private boolean b_uri;
  99. public boolean hasUri() {
  100. return bean.b_uri;
  101. }
  102. public java.lang.String getUri() {
  103. return bean.f_uri;
  104. }
  105. public ImageBean setUri(java.lang.String uri) {
  106. copyCheck();
  107. this.b_uri = true;
  108. this.f_uri = uri;
  109. return this;
  110. }
  111. public void clearUri() {
  112. copyCheck();
  113. this.b_uri = false;
  114. this.f_uri = null;
  115. }
  116. // optional string title = 2;
  117. private java.lang.String f_title = null;
  118. private boolean b_title;
  119. public boolean hasTitle() {
  120. return bean.b_title;
  121. }
  122. public java.lang.String getTitle() {
  123. return bean.f_title;
  124. }
  125. public ImageBean setTitle(java.lang.String title) {
  126. copyCheck();
  127. this.b_title = true;
  128. this.f_title = title;
  129. return this;
  130. }
  131. public void clearTitle() {
  132. copyCheck();
  133. this.b_title = false;
  134. this.f_title = null;
  135. }
  136. // optional int32 width = 3;
  137. private int f_width = 0;
  138. private boolean b_width;
  139. public boolean hasWidth() {
  140. return bean.b_width;
  141. }
  142. public int getWidth() {
  143. return bean.f_width;
  144. }
  145. public ImageBean setWidth(int width) {
  146. copyCheck();
  147. this.b_width = true;
  148. this.f_width = width;
  149. return this;
  150. }
  151. public void clearWidth() {
  152. copyCheck();
  153. this.b_width = false;
  154. this.f_width = 0;
  155. }
  156. // optional int32 height = 4;
  157. private int f_height = 0;
  158. private boolean b_height;
  159. public boolean hasHeight() {
  160. return bean.b_height;
  161. }
  162. public int getHeight() {
  163. return bean.f_height;
  164. }
  165. public ImageBean setHeight(int height) {
  166. copyCheck();
  167. this.b_height = true;
  168. this.f_height = height;
  169. return this;
  170. }
  171. public void clearHeight() {
  172. copyCheck();
  173. this.b_height = false;
  174. this.f_height = 0;
  175. }
  176. // optional Size size = 5;
  177. private Image.Size f_size = null;
  178. private boolean b_size;
  179. public boolean hasSize() {
  180. return bean.b_size;
  181. }
  182. public Image.Size getSize() {
  183. return bean.f_size;
  184. }
  185. public ImageBean setSize(Image.Size size) {
  186. copyCheck();
  187. this.b_size = true;
  188. this.f_size = size;
  189. return this;
  190. }
  191. public void clearSize() {
  192. copyCheck();
  193. this.b_size = false;
  194. this.f_size = null;
  195. }
  196. public String toString() {
  197. return toString(new java.lang.StringBuilder(), "").toString();
  198. }
  199. public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
  200. if( hasUri() ) {
  201. sb.append(prefix+"uri: ");
  202. sb.append(getUri());
  203. sb.append("\n");
  204. }
  205. if( hasTitle() ) {
  206. sb.append(prefix+"title: ");
  207. sb.append(getTitle());
  208. sb.append("\n");
  209. }
  210. if( hasWidth() ) {
  211. sb.append(prefix+"width: ");
  212. sb.append(getWidth());
  213. sb.append("\n");
  214. }
  215. if( hasHeight() ) {
  216. sb.append(prefix+"height: ");
  217. sb.append(getHeight());
  218. sb.append("\n");
  219. }
  220. if( hasSize() ) {
  221. sb.append(prefix+"size: ");
  222. sb.append(getSize());
  223. sb.append("\n");
  224. }
  225. return sb;
  226. }
  227. public ImageBean mergeUnframed(java.io.InputStream input) throws java.io.IOException {
  228. return mergeUnframed(new org.apache.activemq.protobuf.CodedInputStream(input));
  229. }
  230. public ImageBean mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
  231. copyCheck();
  232. while (true) {
  233. int tag = input.readTag();
  234. if ((tag & 0x07) == 4) {
  235. return this;
  236. }
  237. switch (tag) {
  238. case 0:
  239. return this;
  240. default: {
  241. break;
  242. }
  243. case 10:
  244. setUri(input.readString());
  245. break;
  246. case 18:
  247. setTitle(input.readString());
  248. break;
  249. case 24:
  250. setWidth(input.readInt32());
  251. break;
  252. case 32:
  253. setHeight(input.readInt32());
  254. break;
  255. case 40:
  256. {
  257. int t = input.readEnum();
  258. Image.Size value = Image.Size.valueOf(t);
  259. if( value !=null ) {
  260. setSize(value);
  261. }
  262. }
  263. break;
  264. }
  265. }
  266. }
  267. public boolean equals(Object obj) {
  268. if( obj==this )
  269. return true;
  270. if( obj==null || obj.getClass()!=ImageBean.class )
  271. return false;
  272. return equals((ImageBean)obj);
  273. }
  274. public boolean equals(ImageBean obj) {
  275. if (hasUri() ^ obj.hasUri() )
  276. return false;
  277. if (hasUri() && ( !getUri().equals(obj.getUri()) ))
  278. return false;
  279. if (hasTitle() ^ obj.hasTitle() )
  280. return false;
  281. if (hasTitle() && ( !getTitle().equals(obj.getTitle()) ))
  282. return false;
  283. if (hasWidth() ^ obj.hasWidth() )
  284. return false;
  285. if (hasWidth() && ( getWidth()!=obj.getWidth() ))
  286. return false;
  287. if (hasHeight() ^ obj.hasHeight() )
  288. return false;
  289. if (hasHeight() && ( getHeight()!=obj.getHeight() ))
  290. return false;
  291. if (hasSize() ^ obj.hasSize() )
  292. return false;
  293. if (hasSize() && ( !getSize().equals(obj.getSize()) ))
  294. return false;
  295. return true;
  296. }
  297. public int hashCode() {
  298. int rc=1125264267;
  299. if (hasUri()) {
  300. rc ^= ( 85324^getUri().hashCode() );
  301. }
  302. if (hasTitle()) {
  303. rc ^= ( 80818744^getTitle().hashCode() );
  304. }
  305. if (hasWidth()) {
  306. rc ^= ( 83574182^getWidth() );
  307. }
  308. if (hasHeight()) {
  309. rc ^= ( -2137162425^getHeight() );
  310. }
  311. if (hasSize()) {
  312. rc ^= ( 2577441^getSize().hashCode() );
  313. }
  314. return rc;
  315. }
  316. public ImageBean mergeFrom(Image other) {
  317. copyCheck();
  318. if (other.hasUri()) {
  319. setUri(other.getUri());
  320. }
  321. if (other.hasTitle()) {
  322. setTitle(other.getTitle());
  323. }
  324. if (other.hasWidth()) {
  325. setWidth(other.getWidth());
  326. }
  327. if (other.hasHeight()) {
  328. setHeight(other.getHeight());
  329. }
  330. if (other.hasSize()) {
  331. setSize(other.getSize());
  332. }
  333. return this;
  334. }
  335. public void clear() {
  336. clearUri();
  337. clearTitle();
  338. clearWidth();
  339. clearHeight();
  340. clearSize();
  341. }
  342. public void readExternal(java.io.DataInput in) throws java.io.IOException {
  343. assert frozen==null : org.apache.activemq.protobuf.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
  344. bean = this;
  345. frozen = null;
  346. if( in.readBoolean() ) {
  347. f_uri = in.readUTF();
  348. b_uri = true;
  349. } else {
  350. f_uri = null;
  351. b_uri = false;
  352. }
  353. if( in.readBoolean() ) {
  354. f_title = in.readUTF();
  355. b_title = true;
  356. } else {
  357. f_title = null;
  358. b_title = false;
  359. }
  360. f_width = in.readInt();
  361. b_width = true;
  362. f_height = in.readInt();
  363. b_height = true;
  364. if( in.readBoolean() ) {
  365. f_size = Image.Size.valueOf(in.readShort());
  366. b_size = true;
  367. } else {
  368. f_size = null;
  369. b_size = false;
  370. }
  371. }
  372. public void writeExternal(java.io.DataOutput out) throws java.io.IOException {
  373. if( bean.f_uri!=null ) {
  374. out.writeBoolean(true);
  375. out.writeUTF(bean.f_uri);
  376. } else {
  377. out.writeBoolean(false);
  378. }
  379. if( bean.f_title!=null ) {
  380. out.writeBoolean(true);
  381. out.writeUTF(bean.f_title);
  382. } else {
  383. out.writeBoolean(false);
  384. }
  385. out.writeInt(bean.f_width);
  386. out.writeInt(bean.f_height);
  387. if( bean.f_size!=null ) {
  388. out.writeBoolean(true);
  389. out.writeShort(bean.f_size.getNumber());
  390. } else {
  391. out.writeBoolean(false);
  392. }
  393. }
  394. }
  395. static public final class ImageBuffer implements org.apache.activemq.protobuf.MessageBuffer<Image.ImageBean, Image.ImageBuffer>, Image {
  396. private ImageBean bean;
  397. private org.apache.activemq.util.buffer.Buffer buffer;
  398. private int size=-1;
  399. private int hashCode;
  400. private ImageBuffer(org.apache.activemq.util.buffer.Buffer buffer) {
  401. this.buffer = buffer;
  402. }
  403. private ImageBuffer(ImageBean bean) {
  404. this.bean = bean;
  405. }
  406. public ImageBean copy() {
  407. return bean().copy();
  408. }
  409. public ImageBuffer freeze() {
  410. return this;
  411. }
  412. private ImageBean bean() {
  413. if (bean == null) {
  414. try {
  415. bean = new ImageBean().mergeUnframed(new org.apache.activemq.protobuf.CodedInputStream(buffer));
  416. bean.frozen=this;
  417. } catch (org.apache.activemq.protobuf.InvalidProtocolBufferException e) {
  418. throw new RuntimeException(e);
  419. } catch (java.io.IOException e) {
  420. throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
  421. }
  422. }
  423. return bean;
  424. }
  425. public String toString() {
  426. return bean().toString();
  427. }
  428. public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
  429. return bean().toString(sb, prefix);
  430. }
  431. // required string uri = 1;
  432. public boolean hasUri() {
  433. return bean().hasUri();
  434. }
  435. public java.lang.String getUri() {
  436. return bean().getUri();
  437. }
  438. // optional string title = 2;
  439. public boolean hasTitle() {
  440. return bean().hasTitle();
  441. }
  442. public java.lang.String getTitle() {
  443. return bean().getTitle();
  444. }
  445. // optional int32 width = 3;
  446. public boolean hasWidth() {
  447. return bean().hasWidth();
  448. }
  449. public int getWidth() {
  450. return bean().getWidth();
  451. }
  452. // optional int32 height = 4;
  453. public boolean hasHeight() {
  454. return bean().hasHeight();
  455. }
  456. public int getHeight() {
  457. return bean().getHeight();
  458. }
  459. // optional Size size = 5;
  460. public boolean hasSize() {
  461. return bean().hasSize();
  462. }
  463. public Image.Size getSize() {
  464. return bean().getSize();
  465. }
  466. public org.apache.activemq.util.buffer.Buffer toUnframedBuffer() {
  467. if( buffer !=null ) {
  468. return buffer;
  469. }
  470. return org.apache.activemq.protobuf.MessageBufferSupport.toUnframedBuffer(this);
  471. }
  472. public org.apache.activemq.util.buffer.Buffer toFramedBuffer() {
  473. return org.apache.activemq.protobuf.MessageBufferSupport.toFramedBuffer(this);
  474. }
  475. public byte[] toUnframedByteArray() {
  476. return toUnframedBuffer().toByteArray();
  477. }
  478. public byte[] toFramedByteArray() {
  479. return toFramedBuffer().toByteArray();
  480. }
  481. public void writeFramed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
  482. output.writeRawVarint32(serializedSizeUnframed());
  483. writeUnframed(output);
  484. }
  485. public void writeFramed(java.io.OutputStream output) throws java.io.IOException {
  486. org.apache.activemq.protobuf.CodedOutputStream codedOutput = new org.apache.activemq.protobuf.CodedOutputStream(output);
  487. writeFramed(codedOutput);
  488. codedOutput.flush();
  489. }
  490. public void writeUnframed(java.io.OutputStream output) throws java.io.IOException {
  491. org.apache.activemq.protobuf.CodedOutputStream codedOutput = new org.apache.activemq.protobuf.CodedOutputStream(output);
  492. writeUnframed(codedOutput);
  493. codedOutput.flush();
  494. }
  495. public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
  496. if (buffer == null) {
  497. int size = serializedSizeUnframed();
  498. buffer = output.getNextBuffer(size);
  499. org.apache.activemq.protobuf.CodedOutputStream original=null;
  500. if( buffer == null ) {
  501. buffer = new org.apache.activemq.util.buffer.Buffer(new byte[size]);
  502. original = output;
  503. output = new org.apache.activemq.protobuf.CodedOutputStream(buffer);
  504. }
  505. output.writeString(1, bean.getUri());
  506. if (bean.hasTitle()) {
  507. output.writeString(2, bean.getTitle());
  508. }
  509. if (bean.hasWidth()) {
  510. output.writeInt32(3, bean.getWidth());
  511. }
  512. if (bean.hasHeight()) {
  513. output.writeInt32(4, bean.getHeight());
  514. }
  515. if (bean.hasSize()) {
  516. output.writeEnum(5, bean.getSize().getNumber());
  517. }
  518. if( original !=null ) {
  519. output.checkNoSpaceLeft();
  520. output = original;
  521. output.writeRawBytes(buffer);
  522. }
  523. } else {
  524. output.writeRawBytes(buffer);
  525. }
  526. }
  527. public int serializedSizeFramed() {
  528. int t = serializedSizeUnframed();
  529. return org.apache.activemq.protobuf.CodedOutputStream.computeRawVarint32Size(t) + t;
  530. }
  531. public int serializedSizeUnframed() {
  532. if (buffer != null) {
  533. return buffer.length;
  534. }
  535. if (size != -1)
  536. return size;
  537. size = 0;
  538. size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(1, getUri());
  539. if (hasTitle()) {
  540. size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(2, getTitle());
  541. }
  542. if (hasWidth()) {
  543. size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(3, getWidth());
  544. }
  545. if (hasHeight()) {
  546. size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(4, getHeight());
  547. }
  548. if (hasSize()) {
  549. size += org.apache.activemq.protobuf.CodedOutputStream.computeEnumSize(5, getSize().getNumber());
  550. }
  551. return size;
  552. }
  553. public static ImageBean parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
  554. return new ImageBean().mergeUnframed(data);
  555. }
  556. public static ImageBean parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
  557. return parseUnframed(new org.apache.activemq.protobuf.CodedInputStream(data));
  558. }
  559. public static ImageBuffer parseUnframed(org.apache.activemq.util.buffer.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
  560. return new ImageBuffer(data);
  561. }
  562. public static ImageBuffer parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
  563. return parseUnframed(new org.apache.activemq.util.buffer.Buffer(data));
  564. }
  565. public static ImageBuffer parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
  566. int length = data.readRawVarint32();
  567. int oldLimit = data.pushLimit(length);
  568. ImageBuffer rc = parseUnframed(data.readRawBytes(length));
  569. data.popLimit(oldLimit);
  570. return rc;
  571. }
  572. public static ImageBuffer parseFramed(org.apache.activemq.util.buffer.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
  573. try {
  574. org.apache.activemq.protobuf.CodedInputStream input = new org.apache.activemq.protobuf.CodedInputStream(data);
  575. ImageBuffer rc = parseFramed(input);
  576. input.checkLastTagWas(0);
  577. return rc;
  578. } catch (org.apache.activemq.protobuf.InvalidProtocolBufferException e) {
  579. throw e;
  580. } catch (java.io.IOException e) {
  581. throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
  582. }
  583. }
  584. public static ImageBuffer parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
  585. return parseFramed(new org.apache.activemq.util.buffer.Buffer(data));
  586. }
  587. public static ImageBuffer parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
  588. return parseUnframed(org.apache.activemq.protobuf.MessageBufferSupport.readFrame(data));
  589. }
  590. public boolean equals(Object obj) {
  591. if( obj==this )
  592. return true;
  593. if( obj==null || obj.getClass()!=ImageBuffer.class )
  594. return false;
  595. return equals((ImageBuffer)obj);
  596. }
  597. public boolean equals(ImageBuffer obj) {
  598. return toUnframedBuffer().equals(obj.toUnframedBuffer());
  599. }
  600. public int hashCode() {
  601. if( hashCode==0 ) {
  602. hashCode=-937877157 ^ toUnframedBuffer().hashCode();
  603. }
  604. return hashCode;
  605. }
  606. public boolean frozen() {
  607. return true;
  608. }
  609. }
  610. }
  611. static public interface Media extends org.apache.activemq.protobuf.PBMessage<Media.MediaBean, Media.MediaBuffer> {
  612. public static enum Player {
  613. JAVA("JAVA", 0),
  614. FLASH("FLASH", 0);
  615. private final String name;
  616. private final int value;
  617. private Player(String name, int value) {
  618. this.name = name;
  619. this.value = value;
  620. }
  621. public final int getNumber() {
  622. return value;
  623. }
  624. public final String toString() {
  625. return name;
  626. }
  627. public static Player valueOf(int value) {
  628. switch (value) {
  629. case 0:
  630. return JAVA;
  631. default:
  632. return null;
  633. }
  634. }
  635. }
  636. // required string uri = 1;
  637. public boolean hasUri();
  638. public java.lang.String getUri();
  639. // optional string title = 2;
  640. public boolean hasTitle();
  641. public java.lang.String getTitle();
  642. // optional int32 width = 3;
  643. public boolean hasWidth();
  644. public int getWidth();
  645. // optional int32 height = 4;
  646. public boolean hasHeight();
  647. public int getHeight();
  648. // optional string format = 5;
  649. public boolean hasFormat();
  650. public java.lang.String getFormat();
  651. // optional int64 duration = 6;
  652. public boolean hasDuration();
  653. public long getDuration();
  654. // optional int64 size = 7;
  655. public boolean hasSize();
  656. public long getSize();
  657. // optional int32 bitrate = 8;
  658. public boolean hasBitrate();
  659. public int getBitrate();
  660. // repeated string person = 9;
  661. public boolean hasPerson();
  662. public java.util.List<java.lang.String> getPersonList();
  663. public int getPersonCount();
  664. public java.lang.String getPerson(int index);
  665. // optional Player player = 10;
  666. public boolean hasPlayer();
  667. public Media.Player getPlayer();
  668. // optional string copyright = 11;
  669. public boolean hasCopyright();
  670. public java.lang.String getCopyright();
  671. public MediaBean copy();
  672. public MediaBuffer freeze();
  673. public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix);
  674. static public final class MediaBean implements Media {
  675. MediaBuffer frozen;
  676. MediaBean bean;
  677. public MediaBean() {
  678. this.bean = this;
  679. }
  680. public MediaBean(MediaBean copy) {
  681. this.bean = copy;
  682. }
  683. public MediaBean copy() {
  684. return new MediaBean(bean);
  685. }
  686. public boolean frozen() {
  687. return frozen!=null;
  688. }
  689. public MediaBuffer freeze() {
  690. if( frozen==null ) {
  691. frozen = new MediaBuffer(bean);
  692. assert deepFreeze();
  693. }
  694. return frozen;
  695. }
  696. private boolean deepFreeze() {
  697. frozen.serializedSizeUnframed();
  698. return true;
  699. }
  700. private void copyCheck() {
  701. assert frozen==null : org.apache.activemq.protobuf.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
  702. if (bean != this) {
  703. copy(bean);
  704. }
  705. }
  706. private void copy(MediaBean other) {
  707. this.bean = this;
  708. this.f_uri = other.f_uri;
  709. this.b_uri = other.b_uri;
  710. this.f_title = other.f_title;
  711. this.b_title = other.b_title;
  712. this.f_width = other.f_width;
  713. this.b_width = other.b_width;
  714. this.f_height = other.f_height;
  715. this.b_height = other.b_height;
  716. this.f_format = other.f_format;
  717. this.b_format = other.b_format;
  718. this.f_duration = other.f_duration;
  719. this.b_duration = other.b_duration;
  720. this.f_size = other.f_size;
  721. this.b_size = other.b_size;
  722. this.f_bitrate = other.f_bitrate;
  723. this.b_bitrate = other.b_bitrate;
  724. this.f_person = other.f_person;
  725. if( this.f_person !=null && !other.frozen()) {
  726. this.f_person = new java.util.ArrayList<java.lang.String>(this.f_person);
  727. }
  728. this.f_player = other.f_player;
  729. this.b_player = other.b_player;
  730. this.f_copyright = other.f_copyright;
  731. this.b_copyright = other.b_copyright;
  732. }
  733. // required string uri = 1;
  734. private java.lang.String f_uri = null;
  735. private boolean b_uri;
  736. public boolean hasUri() {
  737. return bean.b_uri;
  738. }
  739. public java.lang.String getUri() {
  740. return bean.f_uri;
  741. }
  742. public MediaBean setUri(java.lang.String uri) {
  743. copyCheck();
  744. this.b_uri = true;
  745. this.f_uri = uri;
  746. return this;
  747. }
  748. public void clearUri() {
  749. copyCheck();
  750. this.b_uri = false;
  751. this.f_uri = null;
  752. }
  753. // optional string title = 2;
  754. private java.lang.String f_title = null;
  755. private boolean b_title;
  756. public boolean hasTitle() {
  757. return bean.b_title;
  758. }
  759. public java.lang.String getTitle() {
  760. return bean.f_title;
  761. }
  762. public MediaBean setTitle(java.lang.String title) {
  763. copyCheck();
  764. this.b_title = true;
  765. this.f_title = title;
  766. return this;
  767. }
  768. public void clearTitle() {
  769. copyCheck();
  770. this.b_title = false;
  771. this.f_title = null;
  772. }
  773. // optional int32 width = 3;
  774. private int f_width = 0;
  775. private boolean b_width;
  776. public boolean hasWidth() {
  777. return bean.b_width;
  778. }
  779. public int getWidth() {
  780. return bean.f_width;
  781. }
  782. public MediaBean setWidth(int width) {
  783. copyCheck();
  784. this.b_width = true;
  785. this.f_width = width;
  786. return this;
  787. }
  788. public void clearWidth() {
  789. copyCheck();
  790. this.b_width = false;
  791. this.f_width = 0;
  792. }
  793. // optional int32 height = 4;
  794. private int f_height = 0;
  795. private boolean b_height;
  796. public boolean hasHeight() {
  797. return bean.b_height;
  798. }
  799. public int getHeight() {
  800. return bean.f_height;
  801. }
  802. public MediaBean setHeight(int height) {
  803. copyCheck();
  804. this.b_height = true;
  805. this.f_height = height;
  806. return this;
  807. }
  808. public void clearHeight() {
  809. copyCheck();
  810. this.b_height = false;
  811. this.f_height = 0;
  812. }
  813. // optional string format = 5;
  814. private java.lang.String f_format = null;
  815. private boolean b_format;
  816. public boolean hasFormat() {
  817. return bean.b_format;
  818. }
  819. public java.lang.String getFormat() {
  820. return bean.f_format;
  821. }
  822. public MediaBean setFormat(java.lang.String format) {
  823. copyCheck();
  824. this.b_format = true;
  825. this.f_format = format;
  826. return this;
  827. }
  828. public void clearFormat() {
  829. copyCheck();
  830. this.b_format = false;
  831. this.f_format = null;
  832. }
  833. // optional int64 duration = 6;
  834. private long f_duration = 0;
  835. private boolean b_duration;
  836. public boolean hasDuration() {
  837. return bean.b_duration;
  838. }
  839. public long getDuration() {
  840. return bean.f_duration;
  841. }
  842. public MediaBean setDuration(long duration) {
  843. copyCheck();
  844. this.b_duration = true;
  845. this.f_duration = duration;
  846. return this;
  847. }
  848. public void clearDuration() {
  849. copyCheck();
  850. this.b_duration = false;
  851. this.f_duration = 0;
  852. }
  853. // optional int64 size = 7;
  854. private long f_size = 0;
  855. private boolean b_size;
  856. public boolean hasSize() {
  857. return bean.b_size;
  858. }
  859. public long getSize() {
  860. return bean.f_size;
  861. }
  862. public MediaBean setSize(long size) {
  863. copyCheck();
  864. this.b_size = true;
  865. this.f_size = size;
  866. return this;
  867. }
  868. public void clearSize() {
  869. copyCheck();
  870. this.b_size = false;
  871. this.f_size = 0;
  872. }
  873. // optional int32 bitrate = 8;
  874. private int f_bitrate = 0;
  875. private boolean b_bitrate;
  876. public boolean hasBitrate() {
  877. return bean.b_bitrate;
  878. }
  879. public int getBitrate() {
  880. return bean.f_bitrate;
  881. }
  882. public MediaBean setBitrate(int bitrate) {
  883. copyCheck();
  884. this.b_bitrate = true;
  885. this.f_bitrate = bitrate;
  886. return this;
  887. }
  888. public void clearBitrate() {
  889. copyCheck();
  890. this.b_bitrate = false;
  891. this.f_bitrate = 0;
  892. }
  893. // repeated string person = 9;
  894. private java.util.List<java.lang.String> f_person;
  895. public boolean hasPerson() {
  896. return bean.f_person!=null && !bean.f_person.isEmpty();
  897. }
  898. public java.util.List<java.lang.String> getPersonList() {
  899. return bean.f_person;
  900. }
  901. public java.util.List<java.lang.String> createPersonList() {
  902. copyCheck();
  903. if( this.f_person == null ) {
  904. this.f_person = new java.util.ArrayList<java.lang.String>();
  905. }
  906. return bean.f_person;
  907. }
  908. public MediaBean setPersonList(java.util.List<java.lang.String> person) {
  909. copyCheck();
  910. this.f_person = person;
  911. return this;
  912. }
  913. public int getPersonCount() {
  914. if( bean.f_person == null ) {
  915. return 0;
  916. }
  917. return bean.f_person.size();
  918. }
  919. public java.lang.String getPerson(int index) {
  920. if( bean.f_person == null ) {
  921. return null;
  922. }
  923. return bean.f_person.get(index);
  924. }
  925. public MediaBean setPerson(int index, java.lang.String value) {
  926. this.createPersonList().set(index, value);
  927. return this;
  928. }
  929. public MediaBean addPerson(java.lang.String value) {
  930. this.createPersonList().add(value);
  931. return this;
  932. }
  933. public MediaBean addAllPerson(java.lang.Iterable<? extends java.lang.String> collection) {
  934. org.apache.activemq.protobuf.MessageBufferSupport.addAll(collection, this.createPersonList());
  935. return this;
  936. }
  937. public void clearPerson() {
  938. copyCheck();
  939. this.f_person = null;
  940. }
  941. // optional Player player = 10;
  942. private Media.Player f_player = null;
  943. private boolean b_player;
  944. public boolean hasPlayer() {
  945. return bean.b_player;
  946. }
  947. public Media.Player getPlayer() {
  948. return bean.f_player;
  949. }
  950. public MediaBean setPlayer(Media.Player player) {
  951. copyCheck();
  952. this.b_player = true;
  953. this.f_player = player;
  954. return this;
  955. }
  956. public void clearPlayer() {
  957. copyCheck();
  958. this.b_player = false;
  959. this.f_player = null;
  960. }
  961. // optional string copyright = 11;
  962. private java.lang.String f_copyright = null;
  963. private boolean b_copyright;
  964. public boolean hasCopyright() {
  965. return bean.b_copyright;
  966. }
  967. public java.lang.String getCopyright() {
  968. return bean.f_copyright;
  969. }
  970. public MediaBean setCopyright(java.lang.String copyright) {
  971. copyCheck();
  972. this.b_copyright = true;
  973. this.f_copyright = copyright;
  974. return this;
  975. }
  976. public void clearCopyright() {
  977. copyCheck();
  978. this.b_copyright = false;
  979. this.f_copyright = null;
  980. }
  981. public String toString() {
  982. return toString(new java.lang.StringBuilder(), "").toString();
  983. }
  984. public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
  985. if( hasUri() ) {
  986. sb.append(prefix+"uri: ");
  987. sb.append(getUri());
  988. sb.append("\n");
  989. }
  990. if( hasTitle() ) {
  991. sb.append(prefix+"title: ");
  992. sb.append(getTitle());
  993. sb.append("\n");
  994. }
  995. if( hasWidth() ) {
  996. sb.append(prefix+"width: ");
  997. sb.append(getWidth());
  998. sb.append("\n");
  999. }
  1000. if( hasHeight() ) {
  1001. sb.append(prefix+"height: ");
  1002. sb.append(getHeight());
  1003. sb.append("\n");
  1004. }
  1005. if( hasFormat() ) {
  1006. sb.append(prefix+"format: ");
  1007. sb.append(getFormat());
  1008. sb.append("\n");
  1009. }
  1010. if( hasDuration() ) {
  1011. sb.append(prefix+"duration: ");
  1012. sb.append(getDuration());
  1013. sb.append("\n");
  1014. }
  1015. if( hasSize() ) {
  1016. sb.append(prefix+"size: ");
  1017. sb.append(getSize());
  1018. sb.append("\n");
  1019. }
  1020. if( hasBitrate() ) {
  1021. sb.append(prefix+"bitrate: ");
  1022. sb.append(getBitrate());
  1023. sb.append("\n");
  1024. }
  1025. if( hasPerson() ) {
  1026. java.util.List<java.lang.String> l = getPersonList();
  1027. for( int i=0; i < l.size(); i++ ) {
  1028. sb.append(prefix+"person["+i+"]: ");
  1029. sb.append(l.get(i));
  1030. sb.append("\n");
  1031. }
  1032. }
  1033. if( hasPlayer() ) {
  1034. sb.append(prefix+"player: ");
  1035. sb.append(getPlayer());
  1036. sb.append("\n");
  1037. }
  1038. if( hasCopyright() ) {
  1039. sb.append(prefix+"copyright: ");
  1040. sb.append(getCopyright());
  1041. sb.append("\n");
  1042. }
  1043. return sb;
  1044. }
  1045. public MediaBean mergeUnframed(java.io.InputStream input) throws java.io.IOException {
  1046. return mergeUnframed(new org.apache.activemq.protobuf.CodedInputStream(input));
  1047. }
  1048. public MediaBean mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
  1049. copyCheck();
  1050. while (true) {
  1051. int tag = input.readTag();
  1052. if ((tag & 0x07) == 4) {
  1053. return this;
  1054. }
  1055. switch (tag) {
  1056. case 0:
  1057. return this;
  1058. default: {
  1059. break;
  1060. }
  1061. case 10:
  1062. setUri(input.readString());
  1063. break;
  1064. case 18:
  1065. setTitle(input.readString());
  1066. break;
  1067. case 24:
  1068. setWidth(input.readInt32());
  1069. break;
  1070. case 32:
  1071. setHeight(input.readInt32());
  1072. break;
  1073. case 42:
  1074. setFormat(input.readString());
  1075. break;
  1076. case 48:
  1077. setDuration(input.readInt64());
  1078. break;
  1079. case 56:
  1080. setSize(input.readInt64());
  1081. break;
  1082. case 64:
  1083. setBitrate(input.readInt32());
  1084. break;
  1085. case 74:
  1086. createPersonList().add(input.readString());
  1087. break;
  1088. case 80:
  1089. {
  1090. int t = input.readEnum();
  1091. Media.Player value = Media.Player.valueOf(t);
  1092. if( value !=null ) {
  1093. setPlayer(value);
  1094. }
  1095. }
  1096. break;
  1097. case 90:
  1098. setCopyright(input.readString());
  1099. break;
  1100. }
  1101. }
  1102. }
  1103. public boolean equals(Object obj) {
  1104. if( obj==this )
  1105. return true;
  1106. if( obj==null || obj.getClass()!=MediaBean.class )
  1107. return false;
  1108. return equals((MediaBean)obj);
  1109. }
  1110. public boolean equals(MediaBean obj) {
  1111. if (hasUri() ^ obj.hasUri() )
  1112. return false;
  1113. if (hasUri() && ( !getUri().equals(obj.getUri()) ))
  1114. return false;
  1115. if (hasTitle() ^ obj.hasTitle() )
  1116. return false;
  1117. if (hasTitle() && ( !getTitle().equals(obj.getTitle()) ))
  1118. return false;
  1119. if (hasWidth() ^ obj.hasWidth() )
  1120. return false;
  1121. if (hasWidth() && ( getWidth()!=obj.getWidth() ))
  1122. return false;
  1123. if (hasHeight() ^ obj.hasHeight() )
  1124. return false;
  1125. if (hasHeight() && ( getHeight()!=obj.getHeight() ))
  1126. return false;
  1127. if (hasFormat() ^ obj.hasFormat() )
  1128. return false;
  1129. if (hasFormat() && ( !getFormat().equals(obj.getFormat()) ))
  1130. return false;
  1131. if (hasDuration() ^ obj.hasDuration() )
  1132. return false;
  1133. if (hasDuration() && ( getDuration()!=obj.getDuration() ))
  1134. return false;
  1135. if (hasSize() ^ obj.hasSize() )
  1136. return false;
  1137. if (hasSize() && ( getSize()!=obj.getSize() ))
  1138. return false;
  1139. if (hasBitrate() ^ obj.hasBitrate() )
  1140. return false;
  1141. if (hasBitrate() && ( getBitrate()!=obj.getBitrate() ))
  1142. return false;
  1143. if (hasPerson() ^ obj.hasPerson() )
  1144. return false;
  1145. if (hasPerson() && ( !getPersonList().equals(obj.getPersonList()) ))
  1146. return false;
  1147. if (hasPlayer() ^ obj.hasPlayer() )
  1148. return false;
  1149. if (hasPlayer() && ( !getPlayer().equals(obj.getPlayer()) ))
  1150. return false;
  1151. if (hasCopyright() ^ obj.hasCopyright() )
  1152. return false;
  1153. if (hasCopyright() && ( !getCopyright().equals(obj.getCopyright()) ))
  1154. return false;
  1155. return true;
  1156. }
  1157. public int hashCode() {
  1158. int rc=-151091820;
  1159. if (hasUri()) {
  1160. rc ^= ( 85324^getUri().hashCode() );
  1161. }
  1162. if (hasTitle()) {
  1163. rc ^= ( 80818744^getTitle().hashCode() );
  1164. }
  1165. if (hasWidth()) {
  1166. rc ^= ( 83574182^getWidth() );
  1167. }
  1168. if (hasHeight()) {
  1169. rc ^= ( -2137162425^getHeight() );
  1170. }
  1171. if (hasFormat()) {
  1172. rc ^= ( 2110055447^getFormat().hashCode() );
  1173. }
  1174. if (hasDuration()) {
  1175. rc ^= ( -1927368268^(new Long(getDuration())).hashCode() );
  1176. }
  1177. if (hasSize()) {
  1178. rc ^= ( 2577441^(new Long(getSize())).hashCode() );
  1179. }
  1180. if (hasBitrate()) {
  1181. rc ^= ( 1562383181^getBitrate() );
  1182. }
  1183. if (hasPerson()) {
  1184. rc ^= ( -1907849355^getPersonList().hashCode() );
  1185. }
  1186. if (hasPlayer()) {
  1187. rc ^= ( -1901885695^getPlayer().hashCode() );
  1188. }
  1189. if (hasCopyright()) {
  1190. rc ^= ( -768109657^getCopyright().hashCode() );
  1191. }
  1192. return rc;
  1193. }
  1194. public MediaBean mergeFrom(Media other) {
  1195. copyCheck();
  1196. if (other.hasUri()) {
  1197. setUri(other.getUri());
  1198. }
  1199. if (other.hasTitle()) {
  1200. setTitle(other.getTitle());
  1201. }
  1202. if (other.hasWidth()) {
  1203. setWidth(other.getWidth());
  1204. }
  1205. if (other.hasHeight()) {
  1206. setHeight(other.getHeight());
  1207. }
  1208. if (other.hasFormat()) {
  1209. setFormat(other.getFormat());
  1210. }
  1211. if (other.hasDuration()) {
  1212. setDuration(other.getDuration());
  1213. }
  1214. if (other.hasSize()) {
  1215. setSize(other.getSize());
  1216. }
  1217. if (other.hasBitrate()) {
  1218. setBitrate(other.getBitrate());
  1219. }
  1220. if (other.hasPerson()) {
  1221. getPersonList().addAll(other.getPersonList());
  1222. }
  1223. if (other.hasPlayer()) {
  1224. setPlayer(other.getPlayer());
  1225. }
  1226. if (other.hasCopyright()) {
  1227. setCopyright(other.getCopyright());
  1228. }
  1229. return this;
  1230. }
  1231. public void clear() {
  1232. clearUri();
  1233. clearTitle();
  1234. clearWidth();
  1235. clearHeight();
  1236. clearFormat();
  1237. clearDuration();
  1238. clearSize();
  1239. clearBitrate();
  1240. clearPerson();
  1241. clearPlayer();
  1242. clearCopyright();
  1243. }
  1244. public void readExternal(java.io.DataInput in) throws java.io.IOException {
  1245. assert frozen==null : org.apache.activemq.protobuf.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
  1246. bean = this;
  1247. frozen = null;
  1248. if( in.readBoolean() ) {
  1249. f_uri = in.readUTF();
  1250. b_uri = true;
  1251. } else {
  1252. f_uri = null;
  1253. b_uri = false;
  1254. }
  1255. if( in.readBoolean() ) {
  1256. f_title = in.readUTF();
  1257. b_title = true;
  1258. } else {
  1259. f_title = null;
  1260. b_title = false;
  1261. }
  1262. f_width = in.readInt();
  1263. b_width = true;
  1264. f_height = in.readInt();
  1265. b_height = true;
  1266. if( in.readBoolean() ) {
  1267. f_format = in.readUTF();
  1268. b_format = true;
  1269. } else {
  1270. f_format = null;
  1271. b_format = false;
  1272. }
  1273. f_duration = in.readLong();
  1274. b_duration = true;
  1275. f_size = in.readLong();
  1276. b_size = true;
  1277. f_bitrate = in.readInt();
  1278. b_bitrate = true;
  1279. {
  1280. int size = in.readShort();
  1281. if( size>=0 ) {
  1282. f_person = new java.util.ArrayList<java.lang.String>(size);
  1283. for(int i=0; i<size; i++) {
  1284. f_person.add(in.readUTF());
  1285. }
  1286. } else {
  1287. f_person = null;
  1288. }
  1289. }
  1290. if( in.readBoolean() ) {
  1291. f_player = Media.Player.valueOf(in.readShort());
  1292. b_player = true;
  1293. } else {
  1294. f_player = null;
  1295. b_player = false;
  1296. }
  1297. if( in.readBoolean() ) {
  1298. f_copyright = in.readUTF();
  1299. b_copyright = true;
  1300. } else {
  1301. f_copyright = null;
  1302. b_copyright = false;
  1303. }
  1304. }
  1305. public void writeExternal(java.io.DataOutput out) throws java.io.IOException {
  1306. if( bean.f_uri!=null ) {
  1307. out.writeBoolean(true);
  1308. out.writeUTF(bean.f_uri);
  1309. } else {
  1310. out.writeBoolean(false);
  1311. }
  1312. if( bean.f_title!=null ) {
  1313. out.writeBoolean(true);
  1314. out.writeUTF(bean.f_title);
  1315. } else {
  1316. out.writeBoolean(false);
  1317. }
  1318. out.writeInt(bean.f_width);
  1319. out.writeInt(bean.f_height);
  1320. if( bean.f_format!=null ) {
  1321. out.writeBoolean(true);
  1322. out.writeUTF(bean.f_format);
  1323. } else {
  1324. out.writeBoolean(false);
  1325. }
  1326. out.writeLong(bean.f_duration);
  1327. out.writeLong(bean.f_size);
  1328. out.writeInt(bean.f_bitrate);
  1329. if( bean.f_person!=null ) {
  1330. out.writeShort(bean.f_person.size());
  1331. for(java.lang.String o : bean.f_person) {
  1332. out.writeUTF(o);
  1333. }
  1334. } else {
  1335. out.writeShort(-1);
  1336. }
  1337. if( bean.f_player!=null ) {
  1338. out.writeBoolean(true);
  1339. out.writeShort(bean.f_player.getNumber());
  1340. } else {
  1341. out.writeBoolean(false);
  1342. }
  1343. if( bean.f_copyright!=null ) {
  1344. out.writeBoolean(true);
  1345. out.writeUTF(bean.f_copyright);
  1346. } else {
  1347. out.writeBoolean(false);
  1348. }
  1349. }
  1350. }
  1351. static public final class MediaBuffer implements org.apache.activemq.protobuf.MessageBuffer<Media.MediaBean, Media.MediaBuffer>, Media {
  1352. private MediaBean bean;
  1353. private org.apache.activemq.util.buffer.Buffer buffer;
  1354. private int size=-1;
  1355. private int hashCode;
  1356. private MediaBuffer(org.apache.activemq.util.buffer.Buffer buffer) {
  1357. this.buffer = buffer;
  1358. }
  1359. private MediaBuffer(MediaBean bean) {
  1360. this.bean = bean;
  1361. }
  1362. public MediaBean copy() {
  1363. return bean().copy();
  1364. }
  1365. public MediaBuffer freeze() {
  1366. return this;
  1367. }
  1368. private MediaBean bean() {
  1369. if (bean == null) {
  1370. try {
  1371. bean = new MediaBean().mergeUnframed(new org.apache.activemq.protobuf.CodedInputStream(buffer));
  1372. bean.frozen=this;
  1373. } catch (org.apache.activemq.protobuf.InvalidProtocolBufferException e) {
  1374. throw new RuntimeException(e);
  1375. } catch (java.io.IOException e) {
  1376. throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
  1377. }
  1378. }
  1379. return bean;
  1380. }
  1381. public String toString() {
  1382. return bean().toString();
  1383. }
  1384. public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
  1385. return bean().toString(sb, prefix);
  1386. }
  1387. // required string uri = 1;
  1388. public boolean hasUri() {
  1389. return bean().hasUri();
  1390. }
  1391. public java.lang.String getUri() {
  1392. return bean().getUri();
  1393. }
  1394. // optional string title = 2;
  1395. public boolean hasTitle() {
  1396. return bean().hasTitle();
  1397. }
  1398. public java.lang.String getTitle() {
  1399. return bean().getTitle();
  1400. }
  1401. // optional int32 width = 3;
  1402. public boolean hasWidth() {
  1403. return bean().hasWidth();
  1404. }
  1405. public int getWidth() {
  1406. return bean().getWidth();
  1407. }
  1408. // optional int32 height = 4;
  1409. public boolean hasHeight() {
  1410. return bean().hasHeight();
  1411. }
  1412. public int getHeight() {
  1413. return bean().getHeight();
  1414. }
  1415. // optional string format = 5;
  1416. public boolean hasFormat() {
  1417. return bean().hasFormat();
  1418. }
  1419. public java.lang.String getFormat() {
  1420. return bean().getFormat();
  1421. }
  1422. // optional int64 duration = 6;
  1423. public boolean hasDuration() {
  1424. return bean().hasDuration();
  1425. }
  1426. public long getDuration() {
  1427. return bean().getDuration();
  1428. }
  1429. // optional int64 size = 7;
  1430. public boolean hasSize() {
  1431. return bean().hasSize();
  1432. }
  1433. public long getSize() {
  1434. return bean().getSize();
  1435. }
  1436. // optional int32 bitrate = 8;
  1437. public boolean hasBitrate() {
  1438. return bean().hasBitrate();
  1439. }
  1440. public int getBitrate() {
  1441. return bean().getBitrate();
  1442. }
  1443. // repeated string person = 9;
  1444. public boolean hasPerson() {
  1445. return bean().hasPerson();
  1446. }
  1447. public java.util.List<java.lang.String> getPersonList() {
  1448. return bean().getPersonList();
  1449. }
  1450. public int getPersonCount() {
  1451. return bean().getPersonCount();
  1452. }
  1453. public java.lang.String getPerson(int index) {
  1454. return bean().getPerson(index);
  1455. }
  1456. // optional Player player = 10;
  1457. public boolean hasPlayer() {
  1458. return bean().hasPlayer();
  1459. }
  1460. public Media.Player getPlayer() {
  1461. return bean().getPlayer();
  1462. }
  1463. // optional string copyright = 11;
  1464. public boolean hasCopyright() {
  1465. return bean().hasCopyright();
  1466. }
  1467. public java.lang.String getCopyright() {
  1468. return bean().getCopyright();
  1469. }
  1470. public org.apache.activemq.util.buffer.Buffer toUnframedBuffer() {
  1471. if( buffer !=null ) {
  1472. return buffer;
  1473. }
  1474. return org.apache.activemq.protobuf.MessageBufferSupport.toUnframedBuffer(this);
  1475. }
  1476. public org.apache.activemq.util.buffer.Buffer toFramedBuffer() {
  1477. return org.apache.activemq.protobuf.MessageBufferSupport.toFramedBuffer(this);
  1478. }
  1479. public byte[] toUnframedByteArray() {
  1480. return toUnframedBuffer().toByteArray();
  1481. }
  1482. public byte[] toFramedByteArray() {
  1483. return toFramedBuffer().toByteArray();
  1484. }
  1485. public void writeFramed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
  1486. output.writeRawVarint32(serializedSizeUnframed());
  1487. writeUnframed(output);
  1488. }
  1489. public void writeFramed(java.io.OutputStream output) throws java.io.IOException {
  1490. org.apache.activemq.protobuf.CodedOutputStream codedOutput = new org.apache.activemq.protobuf.CodedOutputStream(output);
  1491. writeFramed(codedOutput);
  1492. codedOutput.flush();
  1493. }
  1494. public void writeUnframed(java.io.OutputStream output) throws java.io.IOException {
  1495. org.apache.activemq.protobuf.CodedOutputStream codedOutput = new org.apache.activemq.protobuf.CodedOutputStream(output);
  1496. writeUnframed(codedOutput);
  1497. codedOutput.flush();
  1498. }
  1499. public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
  1500. if (buffer == null) {
  1501. int size = serializedSizeUnframed();
  1502. buffer = output.getNextBuffer(size);
  1503. org.apache.activemq.protobuf.CodedOutputStream original=null;
  1504. if( buffer == null ) {
  1505. buffer = new org.apache.activemq.util.buffer.Buffer(new byte[size]);
  1506. original = output;
  1507. output = new org.apache.activemq.protobuf.CodedOutputStream(buffer);
  1508. }
  1509. output.writeString(1, bean.getUri());
  1510. if (bean.hasTitle()) {
  1511. output.writeString(2, bean.getTitle());
  1512. }
  1513. if (bean.hasWidth()) {
  1514. output.writeInt32(3, bean.getWidth());
  1515. }
  1516. if (bean.hasHeight()) {
  1517. output.writeInt32(4, bean.getHeight());
  1518. }
  1519. if (bean.hasFormat()) {
  1520. output.writeString(5, bean.getFormat());
  1521. }
  1522. if (bean.hasDuration()) {
  1523. output.writeInt64(6, bean.getDuration());
  1524. }
  1525. if (bean.hasSize()) {
  1526. output.writeInt64(7, bean.getSize());
  1527. }
  1528. if (bean.hasBitrate()) {
  1529. output.writeInt32(8, bean.getBitrate());
  1530. }
  1531. if (bean.hasPerson()) {
  1532. for (java.lang.String i : bean.getPersonList()) {
  1533. output.writeString(9, i);
  1534. }
  1535. }
  1536. if (bean.hasPlayer()) {
  1537. output.writeEnum(10, bean.getPlayer().getNumber());
  1538. }
  1539. if (bean.hasCopyright()) {
  1540. output.writeString(11, bean.getCopyright());
  1541. }
  1542. if( original !=null ) {
  1543. output.checkNoSpaceLeft();
  1544. output = original;
  1545. output.writeRawBytes(buffer);
  1546. }
  1547. } else {
  1548. output.writeRawBytes(buffer);
  1549. }
  1550. }
  1551. public int serializedSizeFramed() {
  1552. int t = serializedSizeUnframed();
  1553. return org.apache.activemq.protobuf.CodedOutputStream.computeRawVarint32Size(t) + t;
  1554. }
  1555. public int serializedSizeUnframed() {
  1556. if (buffer != null) {
  1557. return buffer.length;
  1558. }
  1559. if (size != -1)
  1560. return size;
  1561. size = 0;
  1562. size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(1, getUri());
  1563. if (hasTitle()) {
  1564. size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(2, getTitle());
  1565. }
  1566. if (hasWidth()) {
  1567. size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(3, getWidth());
  1568. }
  1569. if (hasHeight()) {
  1570. size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(4, getHeight());
  1571. }
  1572. if (hasFormat()) {
  1573. size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(5, getFormat());
  1574. }
  1575. if (hasDuration()) {
  1576. size += org.apache.activemq.protobuf.CodedOutputStream.computeInt64Size(6, getDuration());
  1577. }
  1578. if (hasSize()) {
  1579. size += org.apache.activemq.protobuf.CodedOutputStream.computeInt64Size(7, getSize());
  1580. }
  1581. if (hasBitrate()) {
  1582. size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(8, getBitrate());
  1583. }
  1584. if (hasPerson()) {
  1585. for (java.lang.String i : getPersonList()) {
  1586. size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(9, i);
  1587. }
  1588. }
  1589. if (hasPlayer()) {
  1590. size += org.apache.activemq.protobuf.CodedOutputStream.computeEnumSize(10, getPlayer().getNumber());
  1591. }
  1592. if (hasCopyright()) {
  1593. size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(11, getCopyright());
  1594. }
  1595. return size;
  1596. }
  1597. public static MediaBean parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
  1598. return new MediaBean().mergeUnframed(data);
  1599. }
  1600. public static MediaBean parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
  1601. return parseUnframed(new org.apache.activemq.protobuf.CodedInputStream(data));
  1602. }
  1603. public static MediaBuffer parseUnframed(org.apache.activemq.util.buffer.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
  1604. return new MediaBuffer(data);
  1605. }
  1606. public static MediaBuffer parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
  1607. return parseUnframed(new org.apache.activemq.util.buffer.Buffer(data));
  1608. }
  1609. public static MediaBuffer parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
  1610. int length = data.readRawVarint32();
  1611. int oldLimit = data.pushLimit(length);
  1612. MediaBuffer rc = parseUnframed(data.readRawBytes(length));
  1613. data.popLimit(oldLimit);
  1614. return rc;
  1615. }
  1616. public static MediaBuffer parseFramed(org.apache.activemq.util.buffer.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
  1617. try {
  1618. org.apache.activemq.protobuf.CodedInputStream input = new org.apache.activemq.protobuf.CodedInputStream(data);
  1619. MediaBuffer rc = parseFramed(input);
  1620. input.checkLastTagWas(0);
  1621. return rc;
  1622. } catch (org.apache.activemq.protobuf.InvalidProtocolBufferException e) {
  1623. throw e;
  1624. } catch (java.io.IOException e) {
  1625. throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
  1626. }
  1627. }
  1628. public static MediaBuffer parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
  1629. return parseFramed(new org.apache.activemq.util.buffer.Buffer(data));
  1630. }
  1631. public static MediaBuffer parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
  1632. return parseUnframed(org.apache.activemq.protobuf.MessageBufferSupport.readFrame(data));
  1633. }
  1634. public boolean equals(Object obj) {
  1635. if( obj==this )
  1636. return true;
  1637. if( obj==null || obj.getClass()!=MediaBuffer.class )
  1638. return false;
  1639. return equals((MediaBuffer)obj);
  1640. }
  1641. public boolean equals(MediaBuffer obj) {
  1642. return toUnframedBuffer().equals(obj.toUnframedBuffer());
  1643. }
  1644. public int hashCode() {
  1645. if( hashCode==0 ) {
  1646. hashCode=844569892 ^ toUnframedBuffer().hashCode();
  1647. }
  1648. return hashCode;
  1649. }
  1650. public boolean frozen() {
  1651. return true;
  1652. }
  1653. }
  1654. }
  1655. static public interface MediaContent extends org.apache.activemq.protobuf.PBMessage<MediaContent.MediaContentBean, MediaContent.MediaContentBuffer> {
  1656. // repeated Image image = 1;
  1657. public boolean hasImage();
  1658. public java.util.List<Image> getImageList();
  1659. public int getImageCount();
  1660. public Image getImage(int index);
  1661. // optional Media media = 2;
  1662. public boolean hasMedia();
  1663. public Media getMedia();
  1664. public MediaContentBean copy();
  1665. public MediaContentBuffer freeze();
  1666. public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix);
  1667. static public final class MediaContentBean implements MediaContent {
  1668. MediaContentBuffer frozen;
  1669. MediaContentBean bean;
  1670. public MediaContentBean() {
  1671. this.bean = this;
  1672. }
  1673. public MediaContentBean(MediaContentBean copy) {
  1674. this.bean = copy;
  1675. }
  1676. public MediaContentBean copy() {
  1677. return new MediaContentBean(bean);
  1678. }
  1679. public boolean frozen() {
  1680. return frozen!=null;
  1681. }
  1682. public MediaContentBuffer freeze() {
  1683. if( frozen==null ) {
  1684. frozen = new MediaContentBuffer(bean);
  1685. assert deepFreeze();
  1686. }
  1687. return frozen;
  1688. }
  1689. private boolean deepFreeze() {
  1690. frozen.serializedSizeUnframed();
  1691. return true;
  1692. }
  1693. private void copyCheck() {
  1694. assert frozen==null : org.apache.activemq.protobuf.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
  1695. if (bean != this) {
  1696. copy(bean);
  1697. }
  1698. }
  1699. private void copy(MediaContentBean other) {
  1700. this.bean = this;
  1701. this.f_image = other.f_image;
  1702. if( this.f_image !=null) {
  1703. this.f_image = new java.util.ArrayList<Image>(other.f_image.size());
  1704. for( Image e : other.f_image) {
  1705. this.f_image.add(e.copy());
  1706. }
  1707. }
  1708. this.f_media = other.f_media;
  1709. if( this.f_media !=null ) {
  1710. this.f_media = this.f_media.copy();
  1711. }
  1712. }
  1713. // repeated Image image = 1;
  1714. private java.util.List<Image> f_image;
  1715. public boolean hasImage() {
  1716. return bean.f_image!=null && !bean.f_image.isEmpty();
  1717. }
  1718. public java.util.List<Image> getImageList() {
  1719. return bean.f_image;
  1720. }
  1721. public java.util.List<Image> createImageList() {
  1722. copyCheck();
  1723. if( this.f_image == null ) {
  1724. this.f_image = new java.util.ArrayList<Image>();
  1725. }
  1726. return bean.f_image;
  1727. }
  1728. public MediaContentBean setImageList(java.util.List<Image> image) {
  1729. copyCheck();
  1730. this.f_image = image;
  1731. return this;
  1732. }
  1733. public int getImageCount() {
  1734. if( bean.f_image == null ) {
  1735. return 0;
  1736. }
  1737. return bean.f_image.size();
  1738. }
  1739. public Image getImage(int index) {
  1740. if( bean.f_image == null ) {
  1741. return null;
  1742. }
  1743. return bean.f_image.get(index);
  1744. }
  1745. public MediaContentBean setImage(int index, Image value) {
  1746. this.createImageList().set(index, value);
  1747. return this;
  1748. }
  1749. public MediaContentBean addImage(Image value) {
  1750. this.createImageList().add(value);
  1751. return this;
  1752. }
  1753. public MediaContentBean addAllImage(java.lang.Iterable<? extends Image> collection) {
  1754. org.apache.activemq.protobuf.MessageBufferSupport.addAll(collection, this.createImageList());
  1755. return this;
  1756. }
  1757. public void clearImage() {
  1758. copyCheck();
  1759. this.f_image = null;
  1760. }
  1761. // optional Media media = 2;
  1762. private Media f_media = null;
  1763. public boolean hasMedia() {
  1764. return bean.f_media!=null;
  1765. }
  1766. publ