/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
Large files are truncated click here to view the full file
- //
- // Generated by protoc, do not edit by hand.
- //
- package serializers.activemq.protobuf;
- public class MediaContentHolder {
- static public interface Image extends org.apache.activemq.protobuf.PBMessage<Image.ImageBean, Image.ImageBuffer> {
- public static enum Size {
- SMALL("SMALL", 0),
- LARGE("LARGE", 1);
- private final String name;
- private final int value;
- private Size(String name, int value) {
- this.name = name;
- this.value = value;
- }
- public final int getNumber() {
- return value;
- }
- public final String toString() {
- return name;
- }
- public static Size valueOf(int value) {
- switch (value) {
- case 0:
- return SMALL;
- case 1:
- return LARGE;
- default:
- return null;
- }
- }
- }
- // required string uri = 1;
- public boolean hasUri();
- public java.lang.String getUri();
- // optional string title = 2;
- public boolean hasTitle();
- public java.lang.String getTitle();
- // optional int32 width = 3;
- public boolean hasWidth();
- public int getWidth();
- // optional int32 height = 4;
- public boolean hasHeight();
- public int getHeight();
- // optional Size size = 5;
- public boolean hasSize();
- public Image.Size getSize();
- public ImageBean copy();
- public ImageBuffer freeze();
- public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix);
- static public final class ImageBean implements Image {
- ImageBuffer frozen;
- ImageBean bean;
- public ImageBean() {
- this.bean = this;
- }
- public ImageBean(ImageBean copy) {
- this.bean = copy;
- }
- public ImageBean copy() {
- return new ImageBean(bean);
- }
- public boolean frozen() {
- return frozen!=null;
- }
- public ImageBuffer freeze() {
- if( frozen==null ) {
- frozen = new ImageBuffer(bean);
- assert deepFreeze();
- }
- return frozen;
- }
- private boolean deepFreeze() {
- frozen.serializedSizeUnframed();
- return true;
- }
- private void copyCheck() {
- assert frozen==null : org.apache.activemq.protobuf.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
- if (bean != this) {
- copy(bean);
- }
- }
- private void copy(ImageBean other) {
- this.bean = this;
- this.f_uri = other.f_uri;
- this.b_uri = other.b_uri;
- this.f_title = other.f_title;
- this.b_title = other.b_title;
- this.f_width = other.f_width;
- this.b_width = other.b_width;
- this.f_height = other.f_height;
- this.b_height = other.b_height;
- this.f_size = other.f_size;
- this.b_size = other.b_size;
- }
- // required string uri = 1;
- private java.lang.String f_uri = null;
- private boolean b_uri;
- public boolean hasUri() {
- return bean.b_uri;
- }
- public java.lang.String getUri() {
- return bean.f_uri;
- }
- public ImageBean setUri(java.lang.String uri) {
- copyCheck();
- this.b_uri = true;
- this.f_uri = uri;
- return this;
- }
- public void clearUri() {
- copyCheck();
- this.b_uri = false;
- this.f_uri = null;
- }
- // optional string title = 2;
- private java.lang.String f_title = null;
- private boolean b_title;
- public boolean hasTitle() {
- return bean.b_title;
- }
- public java.lang.String getTitle() {
- return bean.f_title;
- }
- public ImageBean setTitle(java.lang.String title) {
- copyCheck();
- this.b_title = true;
- this.f_title = title;
- return this;
- }
- public void clearTitle() {
- copyCheck();
- this.b_title = false;
- this.f_title = null;
- }
- // optional int32 width = 3;
- private int f_width = 0;
- private boolean b_width;
- public boolean hasWidth() {
- return bean.b_width;
- }
- public int getWidth() {
- return bean.f_width;
- }
- public ImageBean setWidth(int width) {
- copyCheck();
- this.b_width = true;
- this.f_width = width;
- return this;
- }
- public void clearWidth() {
- copyCheck();
- this.b_width = false;
- this.f_width = 0;
- }
- // optional int32 height = 4;
- private int f_height = 0;
- private boolean b_height;
- public boolean hasHeight() {
- return bean.b_height;
- }
- public int getHeight() {
- return bean.f_height;
- }
- public ImageBean setHeight(int height) {
- copyCheck();
- this.b_height = true;
- this.f_height = height;
- return this;
- }
- public void clearHeight() {
- copyCheck();
- this.b_height = false;
- this.f_height = 0;
- }
- // optional Size size = 5;
- private Image.Size f_size = null;
- private boolean b_size;
- public boolean hasSize() {
- return bean.b_size;
- }
- public Image.Size getSize() {
- return bean.f_size;
- }
- public ImageBean setSize(Image.Size size) {
- copyCheck();
- this.b_size = true;
- this.f_size = size;
- return this;
- }
- public void clearSize() {
- copyCheck();
- this.b_size = false;
- this.f_size = null;
- }
- public String toString() {
- return toString(new java.lang.StringBuilder(), "").toString();
- }
- public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
- if( hasUri() ) {
- sb.append(prefix+"uri: ");
- sb.append(getUri());
- sb.append("\n");
- }
- if( hasTitle() ) {
- sb.append(prefix+"title: ");
- sb.append(getTitle());
- sb.append("\n");
- }
- if( hasWidth() ) {
- sb.append(prefix+"width: ");
- sb.append(getWidth());
- sb.append("\n");
- }
- if( hasHeight() ) {
- sb.append(prefix+"height: ");
- sb.append(getHeight());
- sb.append("\n");
- }
- if( hasSize() ) {
- sb.append(prefix+"size: ");
- sb.append(getSize());
- sb.append("\n");
- }
- return sb;
- }
- public ImageBean mergeUnframed(java.io.InputStream input) throws java.io.IOException {
- return mergeUnframed(new org.apache.activemq.protobuf.CodedInputStream(input));
- }
- public ImageBean mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
- copyCheck();
- while (true) {
- int tag = input.readTag();
- if ((tag & 0x07) == 4) {
- return this;
- }
- switch (tag) {
- case 0:
- return this;
- default: {
- break;
- }
- case 10:
- setUri(input.readString());
- break;
- case 18:
- setTitle(input.readString());
- break;
- case 24:
- setWidth(input.readInt32());
- break;
- case 32:
- setHeight(input.readInt32());
- break;
- case 40:
- {
- int t = input.readEnum();
- Image.Size value = Image.Size.valueOf(t);
- if( value !=null ) {
- setSize(value);
- }
- }
- break;
- }
- }
- }
- public boolean equals(Object obj) {
- if( obj==this )
- return true;
-
- if( obj==null || obj.getClass()!=ImageBean.class )
- return false;
-
- return equals((ImageBean)obj);
- }
-
- public boolean equals(ImageBean obj) {
- if (hasUri() ^ obj.hasUri() )
- return false;
- if (hasUri() && ( !getUri().equals(obj.getUri()) ))
- return false;
- if (hasTitle() ^ obj.hasTitle() )
- return false;
- if (hasTitle() && ( !getTitle().equals(obj.getTitle()) ))
- return false;
- if (hasWidth() ^ obj.hasWidth() )
- return false;
- if (hasWidth() && ( getWidth()!=obj.getWidth() ))
- return false;
- if (hasHeight() ^ obj.hasHeight() )
- return false;
- if (hasHeight() && ( getHeight()!=obj.getHeight() ))
- return false;
- if (hasSize() ^ obj.hasSize() )
- return false;
- if (hasSize() && ( !getSize().equals(obj.getSize()) ))
- return false;
- return true;
- }
-
- public int hashCode() {
- int rc=1125264267;
- if (hasUri()) {
- rc ^= ( 85324^getUri().hashCode() );
- }
- if (hasTitle()) {
- rc ^= ( 80818744^getTitle().hashCode() );
- }
- if (hasWidth()) {
- rc ^= ( 83574182^getWidth() );
- }
- if (hasHeight()) {
- rc ^= ( -2137162425^getHeight() );
- }
- if (hasSize()) {
- rc ^= ( 2577441^getSize().hashCode() );
- }
- return rc;
- }
-
- public ImageBean mergeFrom(Image other) {
- copyCheck();
- if (other.hasUri()) {
- setUri(other.getUri());
- }
- if (other.hasTitle()) {
- setTitle(other.getTitle());
- }
- if (other.hasWidth()) {
- setWidth(other.getWidth());
- }
- if (other.hasHeight()) {
- setHeight(other.getHeight());
- }
- if (other.hasSize()) {
- setSize(other.getSize());
- }
- return this;
- }
- public void clear() {
- clearUri();
- clearTitle();
- clearWidth();
- clearHeight();
- clearSize();
- }
- public void readExternal(java.io.DataInput in) throws java.io.IOException {
- assert frozen==null : org.apache.activemq.protobuf.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
- bean = this;
- frozen = null;
- if( in.readBoolean() ) {
- f_uri = in.readUTF();
- b_uri = true;
- } else {
- f_uri = null;
- b_uri = false;
- }
- if( in.readBoolean() ) {
- f_title = in.readUTF();
- b_title = true;
- } else {
- f_title = null;
- b_title = false;
- }
- f_width = in.readInt();
- b_width = true;
- f_height = in.readInt();
- b_height = true;
- if( in.readBoolean() ) {
- f_size = Image.Size.valueOf(in.readShort());
- b_size = true;
- } else {
- f_size = null;
- b_size = false;
- }
- }
- public void writeExternal(java.io.DataOutput out) throws java.io.IOException {
- if( bean.f_uri!=null ) {
- out.writeBoolean(true);
- out.writeUTF(bean.f_uri);
- } else {
- out.writeBoolean(false);
- }
- if( bean.f_title!=null ) {
- out.writeBoolean(true);
- out.writeUTF(bean.f_title);
- } else {
- out.writeBoolean(false);
- }
- out.writeInt(bean.f_width);
- out.writeInt(bean.f_height);
- if( bean.f_size!=null ) {
- out.writeBoolean(true);
- out.writeShort(bean.f_size.getNumber());
- } else {
- out.writeBoolean(false);
- }
- }
- }
- static public final class ImageBuffer implements org.apache.activemq.protobuf.MessageBuffer<Image.ImageBean, Image.ImageBuffer>, Image {
- private ImageBean bean;
- private org.apache.activemq.util.buffer.Buffer buffer;
- private int size=-1;
- private int hashCode;
- private ImageBuffer(org.apache.activemq.util.buffer.Buffer buffer) {
- this.buffer = buffer;
- }
- private ImageBuffer(ImageBean bean) {
- this.bean = bean;
- }
- public ImageBean copy() {
- return bean().copy();
- }
- public ImageBuffer freeze() {
- return this;
- }
- private ImageBean bean() {
- if (bean == null) {
- try {
- bean = new ImageBean().mergeUnframed(new org.apache.activemq.protobuf.CodedInputStream(buffer));
- bean.frozen=this;
- } catch (org.apache.activemq.protobuf.InvalidProtocolBufferException e) {
- throw new RuntimeException(e);
- } catch (java.io.IOException e) {
- throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
- }
- }
- return bean;
- }
- public String toString() {
- return bean().toString();
- }
- public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
- return bean().toString(sb, prefix);
- }
- // required string uri = 1;
- public boolean hasUri() {
- return bean().hasUri();
- }
- public java.lang.String getUri() {
- return bean().getUri();
- }
- // optional string title = 2;
- public boolean hasTitle() {
- return bean().hasTitle();
- }
- public java.lang.String getTitle() {
- return bean().getTitle();
- }
- // optional int32 width = 3;
- public boolean hasWidth() {
- return bean().hasWidth();
- }
- public int getWidth() {
- return bean().getWidth();
- }
- // optional int32 height = 4;
- public boolean hasHeight() {
- return bean().hasHeight();
- }
- public int getHeight() {
- return bean().getHeight();
- }
- // optional Size size = 5;
- public boolean hasSize() {
- return bean().hasSize();
- }
- public Image.Size getSize() {
- return bean().getSize();
- }
- public org.apache.activemq.util.buffer.Buffer toUnframedBuffer() {
- if( buffer !=null ) {
- return buffer;
- }
- return org.apache.activemq.protobuf.MessageBufferSupport.toUnframedBuffer(this);
- }
- public org.apache.activemq.util.buffer.Buffer toFramedBuffer() {
- return org.apache.activemq.protobuf.MessageBufferSupport.toFramedBuffer(this);
- }
- public byte[] toUnframedByteArray() {
- return toUnframedBuffer().toByteArray();
- }
- public byte[] toFramedByteArray() {
- return toFramedBuffer().toByteArray();
- }
- public void writeFramed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
- output.writeRawVarint32(serializedSizeUnframed());
- writeUnframed(output);
- }
- public void writeFramed(java.io.OutputStream output) throws java.io.IOException {
- org.apache.activemq.protobuf.CodedOutputStream codedOutput = new org.apache.activemq.protobuf.CodedOutputStream(output);
- writeFramed(codedOutput);
- codedOutput.flush();
- }
- public void writeUnframed(java.io.OutputStream output) throws java.io.IOException {
- org.apache.activemq.protobuf.CodedOutputStream codedOutput = new org.apache.activemq.protobuf.CodedOutputStream(output);
- writeUnframed(codedOutput);
- codedOutput.flush();
- }
- public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (buffer == null) {
- int size = serializedSizeUnframed();
- buffer = output.getNextBuffer(size);
- org.apache.activemq.protobuf.CodedOutputStream original=null;
- if( buffer == null ) {
- buffer = new org.apache.activemq.util.buffer.Buffer(new byte[size]);
- original = output;
- output = new org.apache.activemq.protobuf.CodedOutputStream(buffer);
- }
- output.writeString(1, bean.getUri());
- if (bean.hasTitle()) {
- output.writeString(2, bean.getTitle());
- }
- if (bean.hasWidth()) {
- output.writeInt32(3, bean.getWidth());
- }
- if (bean.hasHeight()) {
- output.writeInt32(4, bean.getHeight());
- }
- if (bean.hasSize()) {
- output.writeEnum(5, bean.getSize().getNumber());
- }
- if( original !=null ) {
- output.checkNoSpaceLeft();
- output = original;
- output.writeRawBytes(buffer);
- }
- } else {
- output.writeRawBytes(buffer);
- }
- }
- public int serializedSizeFramed() {
- int t = serializedSizeUnframed();
- return org.apache.activemq.protobuf.CodedOutputStream.computeRawVarint32Size(t) + t;
- }
- public int serializedSizeUnframed() {
- if (buffer != null) {
- return buffer.length;
- }
- if (size != -1)
- return size;
- size = 0;
- size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(1, getUri());
- if (hasTitle()) {
- size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(2, getTitle());
- }
- if (hasWidth()) {
- size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(3, getWidth());
- }
- if (hasHeight()) {
- size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(4, getHeight());
- }
- if (hasSize()) {
- size += org.apache.activemq.protobuf.CodedOutputStream.computeEnumSize(5, getSize().getNumber());
- }
- return size;
- }
- public static ImageBean parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
- return new ImageBean().mergeUnframed(data);
- }
- public static ImageBean parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
- return parseUnframed(new org.apache.activemq.protobuf.CodedInputStream(data));
- }
- public static ImageBuffer parseUnframed(org.apache.activemq.util.buffer.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
- return new ImageBuffer(data);
- }
- public static ImageBuffer parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
- return parseUnframed(new org.apache.activemq.util.buffer.Buffer(data));
- }
- public static ImageBuffer parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
- int length = data.readRawVarint32();
- int oldLimit = data.pushLimit(length);
- ImageBuffer rc = parseUnframed(data.readRawBytes(length));
- data.popLimit(oldLimit);
- return rc;
- }
- public static ImageBuffer parseFramed(org.apache.activemq.util.buffer.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
- try {
- org.apache.activemq.protobuf.CodedInputStream input = new org.apache.activemq.protobuf.CodedInputStream(data);
- ImageBuffer rc = parseFramed(input);
- input.checkLastTagWas(0);
- return rc;
- } catch (org.apache.activemq.protobuf.InvalidProtocolBufferException e) {
- throw e;
- } catch (java.io.IOException e) {
- throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
- }
- }
- public static ImageBuffer parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
- return parseFramed(new org.apache.activemq.util.buffer.Buffer(data));
- }
- public static ImageBuffer parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
- return parseUnframed(org.apache.activemq.protobuf.MessageBufferSupport.readFrame(data));
- }
- public boolean equals(Object obj) {
- if( obj==this )
- return true;
-
- if( obj==null || obj.getClass()!=ImageBuffer.class )
- return false;
-
- return equals((ImageBuffer)obj);
- }
-
- public boolean equals(ImageBuffer obj) {
- return toUnframedBuffer().equals(obj.toUnframedBuffer());
- }
-
- public int hashCode() {
- if( hashCode==0 ) {
- hashCode=-937877157 ^ toUnframedBuffer().hashCode();
- }
- return hashCode;
- }
-
- public boolean frozen() {
- return true;
- }
- }
- }
- static public interface Media extends org.apache.activemq.protobuf.PBMessage<Media.MediaBean, Media.MediaBuffer> {
- public static enum Player {
- JAVA("JAVA", 0),
- FLASH("FLASH", 0);
- private final String name;
- private final int value;
- private Player(String name, int value) {
- this.name = name;
- this.value = value;
- }
- public final int getNumber() {
- return value;
- }
- public final String toString() {
- return name;
- }
- public static Player valueOf(int value) {
- switch (value) {
- case 0:
- return JAVA;
- default:
- return null;
- }
- }
- }
- // required string uri = 1;
- public boolean hasUri();
- public java.lang.String getUri();
- // optional string title = 2;
- public boolean hasTitle();
- public java.lang.String getTitle();
- // optional int32 width = 3;
- public boolean hasWidth();
- public int getWidth();
- // optional int32 height = 4;
- public boolean hasHeight();
- public int getHeight();
- // optional string format = 5;
- public boolean hasFormat();
- public java.lang.String getFormat();
- // optional int64 duration = 6;
- public boolean hasDuration();
- public long getDuration();
- // optional int64 size = 7;
- public boolean hasSize();
- public long getSize();
- // optional int32 bitrate = 8;
- public boolean hasBitrate();
- public int getBitrate();
- // repeated string person = 9;
- public boolean hasPerson();
- public java.util.List<java.lang.String> getPersonList();
- public int getPersonCount();
- public java.lang.String getPerson(int index);
- // optional Player player = 10;
- public boolean hasPlayer();
- public Media.Player getPlayer();
- // optional string copyright = 11;
- public boolean hasCopyright();
- public java.lang.String getCopyright();
- public MediaBean copy();
- public MediaBuffer freeze();
- public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix);
- static public final class MediaBean implements Media {
- MediaBuffer frozen;
- MediaBean bean;
- public MediaBean() {
- this.bean = this;
- }
- public MediaBean(MediaBean copy) {
- this.bean = copy;
- }
- public MediaBean copy() {
- return new MediaBean(bean);
- }
- public boolean frozen() {
- return frozen!=null;
- }
- public MediaBuffer freeze() {
- if( frozen==null ) {
- frozen = new MediaBuffer(bean);
- assert deepFreeze();
- }
- return frozen;
- }
- private boolean deepFreeze() {
- frozen.serializedSizeUnframed();
- return true;
- }
- private void copyCheck() {
- assert frozen==null : org.apache.activemq.protobuf.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
- if (bean != this) {
- copy(bean);
- }
- }
- private void copy(MediaBean other) {
- this.bean = this;
- this.f_uri = other.f_uri;
- this.b_uri = other.b_uri;
- this.f_title = other.f_title;
- this.b_title = other.b_title;
- this.f_width = other.f_width;
- this.b_width = other.b_width;
- this.f_height = other.f_height;
- this.b_height = other.b_height;
- this.f_format = other.f_format;
- this.b_format = other.b_format;
- this.f_duration = other.f_duration;
- this.b_duration = other.b_duration;
- this.f_size = other.f_size;
- this.b_size = other.b_size;
- this.f_bitrate = other.f_bitrate;
- this.b_bitrate = other.b_bitrate;
- this.f_person = other.f_person;
- if( this.f_person !=null && !other.frozen()) {
- this.f_person = new java.util.ArrayList<java.lang.String>(this.f_person);
- }
- this.f_player = other.f_player;
- this.b_player = other.b_player;
- this.f_copyright = other.f_copyright;
- this.b_copyright = other.b_copyright;
- }
- // required string uri = 1;
- private java.lang.String f_uri = null;
- private boolean b_uri;
- public boolean hasUri() {
- return bean.b_uri;
- }
- public java.lang.String getUri() {
- return bean.f_uri;
- }
- public MediaBean setUri(java.lang.String uri) {
- copyCheck();
- this.b_uri = true;
- this.f_uri = uri;
- return this;
- }
- public void clearUri() {
- copyCheck();
- this.b_uri = false;
- this.f_uri = null;
- }
- // optional string title = 2;
- private java.lang.String f_title = null;
- private boolean b_title;
- public boolean hasTitle() {
- return bean.b_title;
- }
- public java.lang.String getTitle() {
- return bean.f_title;
- }
- public MediaBean setTitle(java.lang.String title) {
- copyCheck();
- this.b_title = true;
- this.f_title = title;
- return this;
- }
- public void clearTitle() {
- copyCheck();
- this.b_title = false;
- this.f_title = null;
- }
- // optional int32 width = 3;
- private int f_width = 0;
- private boolean b_width;
- public boolean hasWidth() {
- return bean.b_width;
- }
- public int getWidth() {
- return bean.f_width;
- }
- public MediaBean setWidth(int width) {
- copyCheck();
- this.b_width = true;
- this.f_width = width;
- return this;
- }
- public void clearWidth() {
- copyCheck();
- this.b_width = false;
- this.f_width = 0;
- }
- // optional int32 height = 4;
- private int f_height = 0;
- private boolean b_height;
- public boolean hasHeight() {
- return bean.b_height;
- }
- public int getHeight() {
- return bean.f_height;
- }
- public MediaBean setHeight(int height) {
- copyCheck();
- this.b_height = true;
- this.f_height = height;
- return this;
- }
- public void clearHeight() {
- copyCheck();
- this.b_height = false;
- this.f_height = 0;
- }
- // optional string format = 5;
- private java.lang.String f_format = null;
- private boolean b_format;
- public boolean hasFormat() {
- return bean.b_format;
- }
- public java.lang.String getFormat() {
- return bean.f_format;
- }
- public MediaBean setFormat(java.lang.String format) {
- copyCheck();
- this.b_format = true;
- this.f_format = format;
- return this;
- }
- public void clearFormat() {
- copyCheck();
- this.b_format = false;
- this.f_format = null;
- }
- // optional int64 duration = 6;
- private long f_duration = 0;
- private boolean b_duration;
- public boolean hasDuration() {
- return bean.b_duration;
- }
- public long getDuration() {
- return bean.f_duration;
- }
- public MediaBean setDuration(long duration) {
- copyCheck();
- this.b_duration = true;
- this.f_duration = duration;
- return this;
- }
- public void clearDuration() {
- copyCheck();
- this.b_duration = false;
- this.f_duration = 0;
- }
- // optional int64 size = 7;
- private long f_size = 0;
- private boolean b_size;
- public boolean hasSize() {
- return bean.b_size;
- }
- public long getSize() {
- return bean.f_size;
- }
- public MediaBean setSize(long size) {
- copyCheck();
- this.b_size = true;
- this.f_size = size;
- return this;
- }
- public void clearSize() {
- copyCheck();
- this.b_size = false;
- this.f_size = 0;
- }
- // optional int32 bitrate = 8;
- private int f_bitrate = 0;
- private boolean b_bitrate;
- public boolean hasBitrate() {
- return bean.b_bitrate;
- }
- public int getBitrate() {
- return bean.f_bitrate;
- }
- public MediaBean setBitrate(int bitrate) {
- copyCheck();
- this.b_bitrate = true;
- this.f_bitrate = bitrate;
- return this;
- }
- public void clearBitrate() {
- copyCheck();
- this.b_bitrate = false;
- this.f_bitrate = 0;
- }
- // repeated string person = 9;
- private java.util.List<java.lang.String> f_person;
- public boolean hasPerson() {
- return bean.f_person!=null && !bean.f_person.isEmpty();
- }
- public java.util.List<java.lang.String> getPersonList() {
- return bean.f_person;
- }
- public java.util.List<java.lang.String> createPersonList() {
- copyCheck();
- if( this.f_person == null ) {
- this.f_person = new java.util.ArrayList<java.lang.String>();
- }
- return bean.f_person;
- }
- public MediaBean setPersonList(java.util.List<java.lang.String> person) {
- copyCheck();
- this.f_person = person;
- return this;
- }
- public int getPersonCount() {
- if( bean.f_person == null ) {
- return 0;
- }
- return bean.f_person.size();
- }
- public java.lang.String getPerson(int index) {
- if( bean.f_person == null ) {
- return null;
- }
- return bean.f_person.get(index);
- }
- public MediaBean setPerson(int index, java.lang.String value) {
- this.createPersonList().set(index, value);
- return this;
- }
- public MediaBean addPerson(java.lang.String value) {
- this.createPersonList().add(value);
- return this;
- }
- public MediaBean addAllPerson(java.lang.Iterable<? extends java.lang.String> collection) {
- org.apache.activemq.protobuf.MessageBufferSupport.addAll(collection, this.createPersonList());
- return this;
- }
- public void clearPerson() {
- copyCheck();
- this.f_person = null;
- }
- // optional Player player = 10;
- private Media.Player f_player = null;
- private boolean b_player;
- public boolean hasPlayer() {
- return bean.b_player;
- }
- public Media.Player getPlayer() {
- return bean.f_player;
- }
- public MediaBean setPlayer(Media.Player player) {
- copyCheck();
- this.b_player = true;
- this.f_player = player;
- return this;
- }
- public void clearPlayer() {
- copyCheck();
- this.b_player = false;
- this.f_player = null;
- }
- // optional string copyright = 11;
- private java.lang.String f_copyright = null;
- private boolean b_copyright;
- public boolean hasCopyright() {
- return bean.b_copyright;
- }
- public java.lang.String getCopyright() {
- return bean.f_copyright;
- }
- public MediaBean setCopyright(java.lang.String copyright) {
- copyCheck();
- this.b_copyright = true;
- this.f_copyright = copyright;
- return this;
- }
- public void clearCopyright() {
- copyCheck();
- this.b_copyright = false;
- this.f_copyright = null;
- }
- public String toString() {
- return toString(new java.lang.StringBuilder(), "").toString();
- }
- public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
- if( hasUri() ) {
- sb.append(prefix+"uri: ");
- sb.append(getUri());
- sb.append("\n");
- }
- if( hasTitle() ) {
- sb.append(prefix+"title: ");
- sb.append(getTitle());
- sb.append("\n");
- }
- if( hasWidth() ) {
- sb.append(prefix+"width: ");
- sb.append(getWidth());
- sb.append("\n");
- }
- if( hasHeight() ) {
- sb.append(prefix+"height: ");
- sb.append(getHeight());
- sb.append("\n");
- }
- if( hasFormat() ) {
- sb.append(prefix+"format: ");
- sb.append(getFormat());
- sb.append("\n");
- }
- if( hasDuration() ) {
- sb.append(prefix+"duration: ");
- sb.append(getDuration());
- sb.append("\n");
- }
- if( hasSize() ) {
- sb.append(prefix+"size: ");
- sb.append(getSize());
- sb.append("\n");
- }
- if( hasBitrate() ) {
- sb.append(prefix+"bitrate: ");
- sb.append(getBitrate());
- sb.append("\n");
- }
- if( hasPerson() ) {
- java.util.List<java.lang.String> l = getPersonList();
- for( int i=0; i < l.size(); i++ ) {
- sb.append(prefix+"person["+i+"]: ");
- sb.append(l.get(i));
- sb.append("\n");
- }
- }
- if( hasPlayer() ) {
- sb.append(prefix+"player: ");
- sb.append(getPlayer());
- sb.append("\n");
- }
- if( hasCopyright() ) {
- sb.append(prefix+"copyright: ");
- sb.append(getCopyright());
- sb.append("\n");
- }
- return sb;
- }
- public MediaBean mergeUnframed(java.io.InputStream input) throws java.io.IOException {
- return mergeUnframed(new org.apache.activemq.protobuf.CodedInputStream(input));
- }
- public MediaBean mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
- copyCheck();
- while (true) {
- int tag = input.readTag();
- if ((tag & 0x07) == 4) {
- return this;
- }
- switch (tag) {
- case 0:
- return this;
- default: {
- break;
- }
- case 10:
- setUri(input.readString());
- break;
- case 18:
- setTitle(input.readString());
- break;
- case 24:
- setWidth(input.readInt32());
- break;
- case 32:
- setHeight(input.readInt32());
- break;
- case 42:
- setFormat(input.readString());
- break;
- case 48:
- setDuration(input.readInt64());
- break;
- case 56:
- setSize(input.readInt64());
- break;
- case 64:
- setBitrate(input.readInt32());
- break;
- case 74:
- createPersonList().add(input.readString());
- break;
- case 80:
- {
- int t = input.readEnum();
- Media.Player value = Media.Player.valueOf(t);
- if( value !=null ) {
- setPlayer(value);
- }
- }
- break;
- case 90:
- setCopyright(input.readString());
- break;
- }
- }
- }
- public boolean equals(Object obj) {
- if( obj==this )
- return true;
-
- if( obj==null || obj.getClass()!=MediaBean.class )
- return false;
-
- return equals((MediaBean)obj);
- }
-
- public boolean equals(MediaBean obj) {
- if (hasUri() ^ obj.hasUri() )
- return false;
- if (hasUri() && ( !getUri().equals(obj.getUri()) ))
- return false;
- if (hasTitle() ^ obj.hasTitle() )
- return false;
- if (hasTitle() && ( !getTitle().equals(obj.getTitle()) ))
- return false;
- if (hasWidth() ^ obj.hasWidth() )
- return false;
- if (hasWidth() && ( getWidth()!=obj.getWidth() ))
- return false;
- if (hasHeight() ^ obj.hasHeight() )
- return false;
- if (hasHeight() && ( getHeight()!=obj.getHeight() ))
- return false;
- if (hasFormat() ^ obj.hasFormat() )
- return false;
- if (hasFormat() && ( !getFormat().equals(obj.getFormat()) ))
- return false;
- if (hasDuration() ^ obj.hasDuration() )
- return false;
- if (hasDuration() && ( getDuration()!=obj.getDuration() ))
- return false;
- if (hasSize() ^ obj.hasSize() )
- return false;
- if (hasSize() && ( getSize()!=obj.getSize() ))
- return false;
- if (hasBitrate() ^ obj.hasBitrate() )
- return false;
- if (hasBitrate() && ( getBitrate()!=obj.getBitrate() ))
- return false;
- if (hasPerson() ^ obj.hasPerson() )
- return false;
- if (hasPerson() && ( !getPersonList().equals(obj.getPersonList()) ))
- return false;
- if (hasPlayer() ^ obj.hasPlayer() )
- return false;
- if (hasPlayer() && ( !getPlayer().equals(obj.getPlayer()) ))
- return false;
- if (hasCopyright() ^ obj.hasCopyright() )
- return false;
- if (hasCopyright() && ( !getCopyright().equals(obj.getCopyright()) ))
- return false;
- return true;
- }
-
- public int hashCode() {
- int rc=-151091820;
- if (hasUri()) {
- rc ^= ( 85324^getUri().hashCode() );
- }
- if (hasTitle()) {
- rc ^= ( 80818744^getTitle().hashCode() );
- }
- if (hasWidth()) {
- rc ^= ( 83574182^getWidth() );
- }
- if (hasHeight()) {
- rc ^= ( -2137162425^getHeight() );
- }
- if (hasFormat()) {
- rc ^= ( 2110055447^getFormat().hashCode() );
- }
- if (hasDuration()) {
- rc ^= ( -1927368268^(new Long(getDuration())).hashCode() );
- }
- if (hasSize()) {
- rc ^= ( 2577441^(new Long(getSize())).hashCode() );
- }
- if (hasBitrate()) {
- rc ^= ( 1562383181^getBitrate() );
- }
- if (hasPerson()) {
- rc ^= ( -1907849355^getPersonList().hashCode() );
- }
- if (hasPlayer()) {
- rc ^= ( -1901885695^getPlayer().hashCode() );
- }
- if (hasCopyright()) {
- rc ^= ( -768109657^getCopyright().hashCode() );
- }
- return rc;
- }
-
- public MediaBean mergeFrom(Media other) {
- copyCheck();
- if (other.hasUri()) {
- setUri(other.getUri());
- }
- if (other.hasTitle()) {
- setTitle(other.getTitle());
- }
- if (other.hasWidth()) {
- setWidth(other.getWidth());
- }
- if (other.hasHeight()) {
- setHeight(other.getHeight());
- }
- if (other.hasFormat()) {
- setFormat(other.getFormat());
- }
- if (other.hasDuration()) {
- setDuration(other.getDuration());
- }
- if (other.hasSize()) {
- setSize(other.getSize());
- }
- if (other.hasBitrate()) {
- setBitrate(other.getBitrate());
- }
- if (other.hasPerson()) {
- getPersonList().addAll(other.getPersonList());
- }
- if (other.hasPlayer()) {
- setPlayer(other.getPlayer());
- }
- if (other.hasCopyright()) {
- setCopyright(other.getCopyright());
- }
- return this;
- }
- public void clear() {
- clearUri();
- clearTitle();
- clearWidth();
- clearHeight();
- clearFormat();
- clearDuration();
- clearSize();
- clearBitrate();
- clearPerson();
- clearPlayer();
- clearCopyright();
- }
- public void readExternal(java.io.DataInput in) throws java.io.IOException {
- assert frozen==null : org.apache.activemq.protobuf.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
- bean = this;
- frozen = null;
- if( in.readBoolean() ) {
- f_uri = in.readUTF();
- b_uri = true;
- } else {
- f_uri = null;
- b_uri = false;
- }
- if( in.readBoolean() ) {
- f_title = in.readUTF();
- b_title = true;
- } else {
- f_title = null;
- b_title = false;
- }
- f_width = in.readInt();
- b_width = true;
- f_height = in.readInt();
- b_height = true;
- if( in.readBoolean() ) {
- f_format = in.readUTF();
- b_format = true;
- } else {
- f_format = null;
- b_format = false;
- }
- f_duration = in.readLong();
- b_duration = true;
- f_size = in.readLong();
- b_size = true;
- f_bitrate = in.readInt();
- b_bitrate = true;
- {
- int size = in.readShort();
- if( size>=0 ) {
- f_person = new java.util.ArrayList<java.lang.String>(size);
- for(int i=0; i<size; i++) {
- f_person.add(in.readUTF());
- }
- } else {
- f_person = null;
- }
- }
- if( in.readBoolean() ) {
- f_player = Media.Player.valueOf(in.readShort());
- b_player = true;
- } else {
- f_player = null;
- b_player = false;
- }
- if( in.readBoolean() ) {
- f_copyright = in.readUTF();
- b_copyright = true;
- } else {
- f_copyright = null;
- b_copyright = false;
- }
- }
- public void writeExternal(java.io.DataOutput out) throws java.io.IOException {
- if( bean.f_uri!=null ) {
- out.writeBoolean(true);
- out.writeUTF(bean.f_uri);
- } else {
- out.writeBoolean(false);
- }
- if( bean.f_title!=null ) {
- out.writeBoolean(true);
- out.writeUTF(bean.f_title);
- } else {
- out.writeBoolean(false);
- }
- out.writeInt(bean.f_width);
- out.writeInt(bean.f_height);
- if( bean.f_format!=null ) {
- out.writeBoolean(true);
- out.writeUTF(bean.f_format);
- } else {
- out.writeBoolean(false);
- }
- out.writeLong(bean.f_duration);
- out.writeLong(bean.f_size);
- out.writeInt(bean.f_bitrate);
- if( bean.f_person!=null ) {
- out.writeShort(bean.f_person.size());
- for(java.lang.String o : bean.f_person) {
- out.writeUTF(o);
- }
- } else {
- out.writeShort(-1);
- }
- if( bean.f_player!=null ) {
- out.writeBoolean(true);
- out.writeShort(bean.f_player.getNumber());
- } else {
- out.writeBoolean(false);
- }
- if( bean.f_copyright!=null ) {
- out.writeBoolean(true);
- out.writeUTF(bean.f_copyright);
- } else {
- out.writeBoolean(false);
- }
- }
- }
- static public final class MediaBuffer implements org.apache.activemq.protobuf.MessageBuffer<Media.MediaBean, Media.MediaBuffer>, Media {
- private MediaBean bean;
- private org.apache.activemq.util.buffer.Buffer buffer;
- private int size=-1;
- private int hashCode;
- private MediaBuffer(org.apache.activemq.util.buffer.Buffer buffer) {
- this.buffer = buffer;
- }
- private MediaBuffer(MediaBean bean) {
- this.bean = bean;
- }
- public MediaBean copy() {
- return bean().copy();
- }
- public MediaBuffer freeze() {
- return this;
- }
- private MediaBean bean() {
- if (bean == null) {
- try {
- bean = new MediaBean().mergeUnframed(new org.apache.activemq.protobuf.CodedInputStream(buffer));
- bean.frozen=this;
- } catch (org.apache.activemq.protobuf.InvalidProtocolBufferException e) {
- throw new RuntimeException(e);
- } catch (java.io.IOException e) {
- throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
- }
- }
- return bean;
- }
- public String toString() {
- return bean().toString();
- }
- public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
- return bean().toString(sb, prefix);
- }
- // required string uri = 1;
- public boolean hasUri() {
- return bean().hasUri();
- }
- public java.lang.String getUri() {
- return bean().getUri();
- }
- // optional string title = 2;
- public boolean hasTitle() {
- return bean().hasTitle();
- }
- public java.lang…