diff --git a/distmq-client/src/main/java/com/github/wenweihu86/distmq/client/api/BrokerAPI.java b/distmq-client/src/main/java/com/github/wenweihu86/distmq/client/api/BrokerAPI.java new file mode 100644 index 0000000..6374a3c --- /dev/null +++ b/distmq-client/src/main/java/com/github/wenweihu86/distmq/client/api/BrokerAPI.java @@ -0,0 +1,9 @@ +package com.github.wenweihu86.distmq.client.api; + +/** + * Created by wenweihu86 on 2017/6/15. + */ +public interface BrokerAPI { + BrokerMessage.SendMessageResponse sendMessage(BrokerMessage.SendMessageRequest request); + BrokerMessage.PullMessageResponse pullMessage(BrokerMessage.PullMessageRequest request); +} diff --git a/distmq-client/src/main/java/com/github/wenweihu86/distmq/client/api/BrokerMessage.java b/distmq-client/src/main/java/com/github/wenweihu86/distmq/client/api/BrokerMessage.java new file mode 100644 index 0000000..d7c1499 --- /dev/null +++ b/distmq-client/src/main/java/com/github/wenweihu86/distmq/client/api/BrokerMessage.java @@ -0,0 +1,4403 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: broker.proto + +package com.github.wenweihu86.distmq.client.api; + +public final class BrokerMessage { + private BrokerMessage() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code api.ResCode} + */ + public enum ResCode + implements com.google.protobuf.ProtocolMessageEnum { + /** + * RES_CODE_SUCCESS = 0; + */ + RES_CODE_SUCCESS(0), + /** + * RES_CODE_FAIL = 1; + */ + RES_CODE_FAIL(1), + UNRECOGNIZED(-1), + ; + + /** + * RES_CODE_SUCCESS = 0; + */ + public static final int RES_CODE_SUCCESS_VALUE = 0; + /** + * RES_CODE_FAIL = 1; + */ + public static final int RES_CODE_FAIL_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ResCode valueOf(int value) { + return forNumber(value); + } + + public static ResCode forNumber(int value) { + switch (value) { + case 0: return RES_CODE_SUCCESS; + case 1: return RES_CODE_FAIL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ResCode> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ResCode findValueByNumber(int number) { + return ResCode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.getDescriptor().getEnumTypes().get(0); + } + + private static final ResCode[] VALUES = values(); + + public static ResCode valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ResCode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:api.ResCode) + } + + public interface BaseResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:api.BaseResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .api.ResCode res_code = 1; + */ + int getResCodeValue(); + /** + * optional .api.ResCode res_code = 1; + */ + com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode getResCode(); + + /** + * optional string res_msg = 2; + */ + java.lang.String getResMsg(); + /** + * optional string res_msg = 2; + */ + com.google.protobuf.ByteString + getResMsgBytes(); + } + /** + * Protobuf type {@code api.BaseResponse} + */ + public static final class BaseResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:api.BaseResponse) + BaseResponseOrBuilder { + // Use BaseResponse.newBuilder() to construct. + private BaseResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BaseResponse() { + resCode_ = 0; + resMsg_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private BaseResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + resCode_ = rawValue; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + resMsg_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_BaseResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_BaseResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder.class); + } + + public static final int RES_CODE_FIELD_NUMBER = 1; + private int resCode_; + /** + * optional .api.ResCode res_code = 1; + */ + public int getResCodeValue() { + return resCode_; + } + /** + * optional .api.ResCode res_code = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode getResCode() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode result = com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode.valueOf(resCode_); + return result == null ? com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode.UNRECOGNIZED : result; + } + + public static final int RES_MSG_FIELD_NUMBER = 2; + private volatile java.lang.Object resMsg_; + /** + * optional string res_msg = 2; + */ + public java.lang.String getResMsg() { + java.lang.Object ref = resMsg_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resMsg_ = s; + return s; + } + } + /** + * optional string res_msg = 2; + */ + public com.google.protobuf.ByteString + getResMsgBytes() { + java.lang.Object ref = resMsg_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resMsg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (resCode_ != com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode.RES_CODE_SUCCESS.getNumber()) { + output.writeEnum(1, resCode_); + } + if (!getResMsgBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resMsg_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resCode_ != com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode.RES_CODE_SUCCESS.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, resCode_); + } + if (!getResMsgBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resMsg_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse)) { + return super.equals(obj); + } + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse other = (com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse) obj; + + boolean result = true; + result = result && resCode_ == other.resCode_; + result = result && getResMsg() + .equals(other.getResMsg()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (37 * hash) + RES_CODE_FIELD_NUMBER; + hash = (53 * hash) + resCode_; + hash = (37 * hash) + RES_MSG_FIELD_NUMBER; + hash = (53 * hash) + getResMsg().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code api.BaseResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:api.BaseResponse) + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_BaseResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_BaseResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder.class); + } + + // Construct using com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + resCode_ = 0; + + resMsg_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_BaseResponse_descriptor; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse getDefaultInstanceForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.getDefaultInstance(); + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse build() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse buildPartial() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse result = new com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse(this); + result.resCode_ = resCode_; + result.resMsg_ = resMsg_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse) { + return mergeFrom((com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse other) { + if (other == com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.getDefaultInstance()) return this; + if (other.resCode_ != 0) { + setResCodeValue(other.getResCodeValue()); + } + if (!other.getResMsg().isEmpty()) { + resMsg_ = other.resMsg_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int resCode_ = 0; + /** + * optional .api.ResCode res_code = 1; + */ + public int getResCodeValue() { + return resCode_; + } + /** + * optional .api.ResCode res_code = 1; + */ + public Builder setResCodeValue(int value) { + resCode_ = value; + onChanged(); + return this; + } + /** + * optional .api.ResCode res_code = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode getResCode() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode result = com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode.valueOf(resCode_); + return result == null ? com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode.UNRECOGNIZED : result; + } + /** + * optional .api.ResCode res_code = 1; + */ + public Builder setResCode(com.github.wenweihu86.distmq.client.api.BrokerMessage.ResCode value) { + if (value == null) { + throw new NullPointerException(); + } + + resCode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * optional .api.ResCode res_code = 1; + */ + public Builder clearResCode() { + + resCode_ = 0; + onChanged(); + return this; + } + + private java.lang.Object resMsg_ = ""; + /** + * optional string res_msg = 2; + */ + public java.lang.String getResMsg() { + java.lang.Object ref = resMsg_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resMsg_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string res_msg = 2; + */ + public com.google.protobuf.ByteString + getResMsgBytes() { + java.lang.Object ref = resMsg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resMsg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string res_msg = 2; + */ + public Builder setResMsg( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resMsg_ = value; + onChanged(); + return this; + } + /** + * optional string res_msg = 2; + */ + public Builder clearResMsg() { + + resMsg_ = getDefaultInstance().getResMsg(); + onChanged(); + return this; + } + /** + * optional string res_msg = 2; + */ + public Builder setResMsgBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resMsg_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:api.BaseResponse) + } + + // @@protoc_insertion_point(class_scope:api.BaseResponse) + private static final com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse(); + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public BaseResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BaseResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MessageContentOrBuilder extends + // @@protoc_insertion_point(interface_extends:api.MessageContent) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string topic = 1; + */ + java.lang.String getTopic(); + /** + * optional string topic = 1; + */ + com.google.protobuf.ByteString + getTopicBytes(); + + /** + * optional int32 queue = 2; + */ + int getQueue(); + + /** + * optional int64 offset = 3; + */ + long getOffset(); + + /** + * optional bytes content = 4; + */ + com.google.protobuf.ByteString getContent(); + } + /** + * Protobuf type {@code api.MessageContent} + */ + public static final class MessageContent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:api.MessageContent) + MessageContentOrBuilder { + // Use MessageContent.newBuilder() to construct. + private MessageContent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private MessageContent() { + topic_ = ""; + queue_ = 0; + offset_ = 0L; + content_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private MessageContent( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + case 16: { + + queue_ = input.readInt32(); + break; + } + case 24: { + + offset_ = input.readInt64(); + break; + } + case 34: { + + content_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_MessageContent_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_MessageContent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.Builder.class); + } + + public static final int TOPIC_FIELD_NUMBER = 1; + private volatile java.lang.Object topic_; + /** + * optional string topic = 1; + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } + } + /** + * optional string topic = 1; + */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUEUE_FIELD_NUMBER = 2; + private int queue_; + /** + * optional int32 queue = 2; + */ + public int getQueue() { + return queue_; + } + + public static final int OFFSET_FIELD_NUMBER = 3; + private long offset_; + /** + * optional int64 offset = 3; + */ + public long getOffset() { + return offset_; + } + + public static final int CONTENT_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString content_; + /** + * optional bytes content = 4; + */ + public com.google.protobuf.ByteString getContent() { + return content_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_); + } + if (queue_ != 0) { + output.writeInt32(2, queue_); + } + if (offset_ != 0L) { + output.writeInt64(3, offset_); + } + if (!content_.isEmpty()) { + output.writeBytes(4, content_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_); + } + if (queue_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, queue_); + } + if (offset_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, offset_); + } + if (!content_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, content_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent)) { + return super.equals(obj); + } + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent other = (com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent) obj; + + boolean result = true; + result = result && getTopic() + .equals(other.getTopic()); + result = result && (getQueue() + == other.getQueue()); + result = result && (getOffset() + == other.getOffset()); + result = result && getContent() + .equals(other.getContent()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (37 * hash) + TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getTopic().hashCode(); + hash = (37 * hash) + QUEUE_FIELD_NUMBER; + hash = (53 * hash) + getQueue(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOffset()); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code api.MessageContent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:api.MessageContent) + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_MessageContent_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_MessageContent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.Builder.class); + } + + // Construct using com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + topic_ = ""; + + queue_ = 0; + + offset_ = 0L; + + content_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_MessageContent_descriptor; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent getDefaultInstanceForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.getDefaultInstance(); + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent build() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent buildPartial() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent result = new com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent(this); + result.topic_ = topic_; + result.queue_ = queue_; + result.offset_ = offset_; + result.content_ = content_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent) { + return mergeFrom((com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent other) { + if (other == com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.getDefaultInstance()) return this; + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + if (other.getQueue() != 0) { + setQueue(other.getQueue()); + } + if (other.getOffset() != 0L) { + setOffset(other.getOffset()); + } + if (other.getContent() != com.google.protobuf.ByteString.EMPTY) { + setContent(other.getContent()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object topic_ = ""; + /** + * optional string topic = 1; + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string topic = 1; + */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string topic = 1; + */ + public Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + * optional string topic = 1; + */ + public Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + * optional string topic = 1; + */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + + private int queue_ ; + /** + * optional int32 queue = 2; + */ + public int getQueue() { + return queue_; + } + /** + * optional int32 queue = 2; + */ + public Builder setQueue(int value) { + + queue_ = value; + onChanged(); + return this; + } + /** + * optional int32 queue = 2; + */ + public Builder clearQueue() { + + queue_ = 0; + onChanged(); + return this; + } + + private long offset_ ; + /** + * optional int64 offset = 3; + */ + public long getOffset() { + return offset_; + } + /** + * optional int64 offset = 3; + */ + public Builder setOffset(long value) { + + offset_ = value; + onChanged(); + return this; + } + /** + * optional int64 offset = 3; + */ + public Builder clearOffset() { + + offset_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes content = 4; + */ + public com.google.protobuf.ByteString getContent() { + return content_; + } + /** + * optional bytes content = 4; + */ + public Builder setContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * optional bytes content = 4; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:api.MessageContent) + } + + // @@protoc_insertion_point(class_scope:api.MessageContent) + private static final com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent(); + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public MessageContent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MessageContent(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SendMessageRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:api.SendMessageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string topic = 1; + */ + java.lang.String getTopic(); + /** + * optional string topic = 1; + */ + com.google.protobuf.ByteString + getTopicBytes(); + + /** + * optional int32 queue = 2; + */ + int getQueue(); + + /** + * optional bytes content = 3; + */ + com.google.protobuf.ByteString getContent(); + } + /** + * Protobuf type {@code api.SendMessageRequest} + */ + public static final class SendMessageRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:api.SendMessageRequest) + SendMessageRequestOrBuilder { + // Use SendMessageRequest.newBuilder() to construct. + private SendMessageRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SendMessageRequest() { + topic_ = ""; + queue_ = 0; + content_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private SendMessageRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + case 16: { + + queue_ = input.readInt32(); + break; + } + case 26: { + + content_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_SendMessageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_SendMessageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest.Builder.class); + } + + public static final int TOPIC_FIELD_NUMBER = 1; + private volatile java.lang.Object topic_; + /** + * optional string topic = 1; + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } + } + /** + * optional string topic = 1; + */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUEUE_FIELD_NUMBER = 2; + private int queue_; + /** + * optional int32 queue = 2; + */ + public int getQueue() { + return queue_; + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString content_; + /** + * optional bytes content = 3; + */ + public com.google.protobuf.ByteString getContent() { + return content_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_); + } + if (queue_ != 0) { + output.writeInt32(2, queue_); + } + if (!content_.isEmpty()) { + output.writeBytes(3, content_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_); + } + if (queue_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, queue_); + } + if (!content_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, content_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest)) { + return super.equals(obj); + } + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest other = (com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest) obj; + + boolean result = true; + result = result && getTopic() + .equals(other.getTopic()); + result = result && (getQueue() + == other.getQueue()); + result = result && getContent() + .equals(other.getContent()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (37 * hash) + TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getTopic().hashCode(); + hash = (37 * hash) + QUEUE_FIELD_NUMBER; + hash = (53 * hash) + getQueue(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code api.SendMessageRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:api.SendMessageRequest) + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_SendMessageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_SendMessageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest.Builder.class); + } + + // Construct using com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + topic_ = ""; + + queue_ = 0; + + content_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_SendMessageRequest_descriptor; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest getDefaultInstanceForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest.getDefaultInstance(); + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest build() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest buildPartial() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest result = new com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest(this); + result.topic_ = topic_; + result.queue_ = queue_; + result.content_ = content_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest) { + return mergeFrom((com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest other) { + if (other == com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest.getDefaultInstance()) return this; + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + if (other.getQueue() != 0) { + setQueue(other.getQueue()); + } + if (other.getContent() != com.google.protobuf.ByteString.EMPTY) { + setContent(other.getContent()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object topic_ = ""; + /** + * optional string topic = 1; + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string topic = 1; + */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string topic = 1; + */ + public Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + * optional string topic = 1; + */ + public Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + * optional string topic = 1; + */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + + private int queue_ ; + /** + * optional int32 queue = 2; + */ + public int getQueue() { + return queue_; + } + /** + * optional int32 queue = 2; + */ + public Builder setQueue(int value) { + + queue_ = value; + onChanged(); + return this; + } + /** + * optional int32 queue = 2; + */ + public Builder clearQueue() { + + queue_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes content = 3; + */ + public com.google.protobuf.ByteString getContent() { + return content_; + } + /** + * optional bytes content = 3; + */ + public Builder setContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * optional bytes content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:api.SendMessageRequest) + } + + // @@protoc_insertion_point(class_scope:api.SendMessageRequest) + private static final com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest(); + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public SendMessageRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SendMessageRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SendMessageResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:api.SendMessageResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .api.BaseResponse base_res = 1; + */ + boolean hasBaseRes(); + /** + * optional .api.BaseResponse base_res = 1; + */ + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse getBaseRes(); + /** + * optional .api.BaseResponse base_res = 1; + */ + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder getBaseResOrBuilder(); + } + /** + * Protobuf type {@code api.SendMessageResponse} + */ + public static final class SendMessageResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:api.SendMessageResponse) + SendMessageResponseOrBuilder { + // Use SendMessageResponse.newBuilder() to construct. + private SendMessageResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SendMessageResponse() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private SendMessageResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder subBuilder = null; + if (baseRes_ != null) { + subBuilder = baseRes_.toBuilder(); + } + baseRes_ = input.readMessage(com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(baseRes_); + baseRes_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_SendMessageResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_SendMessageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse.Builder.class); + } + + public static final int BASE_RES_FIELD_NUMBER = 1; + private com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse baseRes_; + /** + * optional .api.BaseResponse base_res = 1; + */ + public boolean hasBaseRes() { + return baseRes_ != null; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse getBaseRes() { + return baseRes_ == null ? com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.getDefaultInstance() : baseRes_; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder getBaseResOrBuilder() { + return getBaseRes(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (baseRes_ != null) { + output.writeMessage(1, getBaseRes()); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (baseRes_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getBaseRes()); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse)) { + return super.equals(obj); + } + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse other = (com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse) obj; + + boolean result = true; + result = result && (hasBaseRes() == other.hasBaseRes()); + if (hasBaseRes()) { + result = result && getBaseRes() + .equals(other.getBaseRes()); + } + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasBaseRes()) { + hash = (37 * hash) + BASE_RES_FIELD_NUMBER; + hash = (53 * hash) + getBaseRes().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code api.SendMessageResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:api.SendMessageResponse) + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_SendMessageResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_SendMessageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse.Builder.class); + } + + // Construct using com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (baseResBuilder_ == null) { + baseRes_ = null; + } else { + baseRes_ = null; + baseResBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_SendMessageResponse_descriptor; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse getDefaultInstanceForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse.getDefaultInstance(); + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse build() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse buildPartial() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse result = new com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse(this); + if (baseResBuilder_ == null) { + result.baseRes_ = baseRes_; + } else { + result.baseRes_ = baseResBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse) { + return mergeFrom((com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse other) { + if (other == com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse.getDefaultInstance()) return this; + if (other.hasBaseRes()) { + mergeBaseRes(other.getBaseRes()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse baseRes_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder> baseResBuilder_; + /** + * optional .api.BaseResponse base_res = 1; + */ + public boolean hasBaseRes() { + return baseResBuilder_ != null || baseRes_ != null; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse getBaseRes() { + if (baseResBuilder_ == null) { + return baseRes_ == null ? com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.getDefaultInstance() : baseRes_; + } else { + return baseResBuilder_.getMessage(); + } + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public Builder setBaseRes(com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse value) { + if (baseResBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + baseRes_ = value; + onChanged(); + } else { + baseResBuilder_.setMessage(value); + } + + return this; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public Builder setBaseRes( + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder builderForValue) { + if (baseResBuilder_ == null) { + baseRes_ = builderForValue.build(); + onChanged(); + } else { + baseResBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public Builder mergeBaseRes(com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse value) { + if (baseResBuilder_ == null) { + if (baseRes_ != null) { + baseRes_ = + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.newBuilder(baseRes_).mergeFrom(value).buildPartial(); + } else { + baseRes_ = value; + } + onChanged(); + } else { + baseResBuilder_.mergeFrom(value); + } + + return this; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public Builder clearBaseRes() { + if (baseResBuilder_ == null) { + baseRes_ = null; + onChanged(); + } else { + baseRes_ = null; + baseResBuilder_ = null; + } + + return this; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder getBaseResBuilder() { + + onChanged(); + return getBaseResFieldBuilder().getBuilder(); + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder getBaseResOrBuilder() { + if (baseResBuilder_ != null) { + return baseResBuilder_.getMessageOrBuilder(); + } else { + return baseRes_ == null ? + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.getDefaultInstance() : baseRes_; + } + } + /** + * optional .api.BaseResponse base_res = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder> + getBaseResFieldBuilder() { + if (baseResBuilder_ == null) { + baseResBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder>( + getBaseRes(), + getParentForChildren(), + isClean()); + baseRes_ = null; + } + return baseResBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:api.SendMessageResponse) + } + + // @@protoc_insertion_point(class_scope:api.SendMessageResponse) + private static final com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse(); + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public SendMessageResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SendMessageResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.SendMessageResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PullMessageRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:api.PullMessageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string topic = 1; + */ + java.lang.String getTopic(); + /** + * optional string topic = 1; + */ + com.google.protobuf.ByteString + getTopicBytes(); + + /** + * optional int32 queue = 2; + */ + int getQueue(); + + /** + * optional string consumer_group = 3; + */ + java.lang.String getConsumerGroup(); + /** + * optional string consumer_group = 3; + */ + com.google.protobuf.ByteString + getConsumerGroupBytes(); + + /** + * optional int32 message_count = 4; + */ + int getMessageCount(); + } + /** + * Protobuf type {@code api.PullMessageRequest} + */ + public static final class PullMessageRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:api.PullMessageRequest) + PullMessageRequestOrBuilder { + // Use PullMessageRequest.newBuilder() to construct. + private PullMessageRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PullMessageRequest() { + topic_ = ""; + queue_ = 0; + consumerGroup_ = ""; + messageCount_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private PullMessageRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + case 16: { + + queue_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + consumerGroup_ = s; + break; + } + case 32: { + + messageCount_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_PullMessageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_PullMessageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest.Builder.class); + } + + public static final int TOPIC_FIELD_NUMBER = 1; + private volatile java.lang.Object topic_; + /** + * optional string topic = 1; + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } + } + /** + * optional string topic = 1; + */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUEUE_FIELD_NUMBER = 2; + private int queue_; + /** + * optional int32 queue = 2; + */ + public int getQueue() { + return queue_; + } + + public static final int CONSUMER_GROUP_FIELD_NUMBER = 3; + private volatile java.lang.Object consumerGroup_; + /** + * optional string consumer_group = 3; + */ + public java.lang.String getConsumerGroup() { + java.lang.Object ref = consumerGroup_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerGroup_ = s; + return s; + } + } + /** + * optional string consumer_group = 3; + */ + public com.google.protobuf.ByteString + getConsumerGroupBytes() { + java.lang.Object ref = consumerGroup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + consumerGroup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_COUNT_FIELD_NUMBER = 4; + private int messageCount_; + /** + * optional int32 message_count = 4; + */ + public int getMessageCount() { + return messageCount_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_); + } + if (queue_ != 0) { + output.writeInt32(2, queue_); + } + if (!getConsumerGroupBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, consumerGroup_); + } + if (messageCount_ != 0) { + output.writeInt32(4, messageCount_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_); + } + if (queue_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, queue_); + } + if (!getConsumerGroupBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, consumerGroup_); + } + if (messageCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, messageCount_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest)) { + return super.equals(obj); + } + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest other = (com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest) obj; + + boolean result = true; + result = result && getTopic() + .equals(other.getTopic()); + result = result && (getQueue() + == other.getQueue()); + result = result && getConsumerGroup() + .equals(other.getConsumerGroup()); + result = result && (getMessageCount() + == other.getMessageCount()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (37 * hash) + TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getTopic().hashCode(); + hash = (37 * hash) + QUEUE_FIELD_NUMBER; + hash = (53 * hash) + getQueue(); + hash = (37 * hash) + CONSUMER_GROUP_FIELD_NUMBER; + hash = (53 * hash) + getConsumerGroup().hashCode(); + hash = (37 * hash) + MESSAGE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMessageCount(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code api.PullMessageRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:api.PullMessageRequest) + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_PullMessageRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_PullMessageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest.Builder.class); + } + + // Construct using com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + topic_ = ""; + + queue_ = 0; + + consumerGroup_ = ""; + + messageCount_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_PullMessageRequest_descriptor; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest getDefaultInstanceForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest.getDefaultInstance(); + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest build() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest buildPartial() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest result = new com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest(this); + result.topic_ = topic_; + result.queue_ = queue_; + result.consumerGroup_ = consumerGroup_; + result.messageCount_ = messageCount_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest) { + return mergeFrom((com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest other) { + if (other == com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest.getDefaultInstance()) return this; + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + if (other.getQueue() != 0) { + setQueue(other.getQueue()); + } + if (!other.getConsumerGroup().isEmpty()) { + consumerGroup_ = other.consumerGroup_; + onChanged(); + } + if (other.getMessageCount() != 0) { + setMessageCount(other.getMessageCount()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object topic_ = ""; + /** + * optional string topic = 1; + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string topic = 1; + */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string topic = 1; + */ + public Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + * optional string topic = 1; + */ + public Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + * optional string topic = 1; + */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + + private int queue_ ; + /** + * optional int32 queue = 2; + */ + public int getQueue() { + return queue_; + } + /** + * optional int32 queue = 2; + */ + public Builder setQueue(int value) { + + queue_ = value; + onChanged(); + return this; + } + /** + * optional int32 queue = 2; + */ + public Builder clearQueue() { + + queue_ = 0; + onChanged(); + return this; + } + + private java.lang.Object consumerGroup_ = ""; + /** + * optional string consumer_group = 3; + */ + public java.lang.String getConsumerGroup() { + java.lang.Object ref = consumerGroup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + consumerGroup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string consumer_group = 3; + */ + public com.google.protobuf.ByteString + getConsumerGroupBytes() { + java.lang.Object ref = consumerGroup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + consumerGroup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string consumer_group = 3; + */ + public Builder setConsumerGroup( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + consumerGroup_ = value; + onChanged(); + return this; + } + /** + * optional string consumer_group = 3; + */ + public Builder clearConsumerGroup() { + + consumerGroup_ = getDefaultInstance().getConsumerGroup(); + onChanged(); + return this; + } + /** + * optional string consumer_group = 3; + */ + public Builder setConsumerGroupBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + consumerGroup_ = value; + onChanged(); + return this; + } + + private int messageCount_ ; + /** + * optional int32 message_count = 4; + */ + public int getMessageCount() { + return messageCount_; + } + /** + * optional int32 message_count = 4; + */ + public Builder setMessageCount(int value) { + + messageCount_ = value; + onChanged(); + return this; + } + /** + * optional int32 message_count = 4; + */ + public Builder clearMessageCount() { + + messageCount_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:api.PullMessageRequest) + } + + // @@protoc_insertion_point(class_scope:api.PullMessageRequest) + private static final com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest(); + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PullMessageRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PullMessageRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PullMessageResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:api.PullMessageResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .api.BaseResponse base_res = 1; + */ + boolean hasBaseRes(); + /** + * optional .api.BaseResponse base_res = 1; + */ + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse getBaseRes(); + /** + * optional .api.BaseResponse base_res = 1; + */ + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder getBaseResOrBuilder(); + + /** + * repeated .api.MessageContent contents = 2; + */ + java.util.List + getContentsList(); + /** + * repeated .api.MessageContent contents = 2; + */ + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent getContents(int index); + /** + * repeated .api.MessageContent contents = 2; + */ + int getContentsCount(); + /** + * repeated .api.MessageContent contents = 2; + */ + java.util.List + getContentsOrBuilderList(); + /** + * repeated .api.MessageContent contents = 2; + */ + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContentOrBuilder getContentsOrBuilder( + int index); + } + /** + * Protobuf type {@code api.PullMessageResponse} + */ + public static final class PullMessageResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:api.PullMessageResponse) + PullMessageResponseOrBuilder { + // Use PullMessageResponse.newBuilder() to construct. + private PullMessageResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PullMessageResponse() { + contents_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private PullMessageResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder subBuilder = null; + if (baseRes_ != null) { + subBuilder = baseRes_.toBuilder(); + } + baseRes_ = input.readMessage(com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(baseRes_); + baseRes_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + contents_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + contents_.add( + input.readMessage(com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.parser(), extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + contents_ = java.util.Collections.unmodifiableList(contents_); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_PullMessageResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_PullMessageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse.Builder.class); + } + + private int bitField0_; + public static final int BASE_RES_FIELD_NUMBER = 1; + private com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse baseRes_; + /** + * optional .api.BaseResponse base_res = 1; + */ + public boolean hasBaseRes() { + return baseRes_ != null; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse getBaseRes() { + return baseRes_ == null ? com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.getDefaultInstance() : baseRes_; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder getBaseResOrBuilder() { + return getBaseRes(); + } + + public static final int CONTENTS_FIELD_NUMBER = 2; + private java.util.List contents_; + /** + * repeated .api.MessageContent contents = 2; + */ + public java.util.List getContentsList() { + return contents_; + } + /** + * repeated .api.MessageContent contents = 2; + */ + public java.util.List + getContentsOrBuilderList() { + return contents_; + } + /** + * repeated .api.MessageContent contents = 2; + */ + public int getContentsCount() { + return contents_.size(); + } + /** + * repeated .api.MessageContent contents = 2; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent getContents(int index) { + return contents_.get(index); + } + /** + * repeated .api.MessageContent contents = 2; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContentOrBuilder getContentsOrBuilder( + int index) { + return contents_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (baseRes_ != null) { + output.writeMessage(1, getBaseRes()); + } + for (int i = 0; i < contents_.size(); i++) { + output.writeMessage(2, contents_.get(i)); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (baseRes_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getBaseRes()); + } + for (int i = 0; i < contents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, contents_.get(i)); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse)) { + return super.equals(obj); + } + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse other = (com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse) obj; + + boolean result = true; + result = result && (hasBaseRes() == other.hasBaseRes()); + if (hasBaseRes()) { + result = result && getBaseRes() + .equals(other.getBaseRes()); + } + result = result && getContentsList() + .equals(other.getContentsList()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasBaseRes()) { + hash = (37 * hash) + BASE_RES_FIELD_NUMBER; + hash = (53 * hash) + getBaseRes().hashCode(); + } + if (getContentsCount() > 0) { + hash = (37 * hash) + CONTENTS_FIELD_NUMBER; + hash = (53 * hash) + getContentsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code api.PullMessageResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:api.PullMessageResponse) + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_PullMessageResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_PullMessageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse.class, com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse.Builder.class); + } + + // Construct using com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getContentsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (baseResBuilder_ == null) { + baseRes_ = null; + } else { + baseRes_ = null; + baseResBuilder_ = null; + } + if (contentsBuilder_ == null) { + contents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + contentsBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.internal_static_api_PullMessageResponse_descriptor; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse getDefaultInstanceForType() { + return com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse.getDefaultInstance(); + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse build() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse buildPartial() { + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse result = new com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (baseResBuilder_ == null) { + result.baseRes_ = baseRes_; + } else { + result.baseRes_ = baseResBuilder_.build(); + } + if (contentsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + contents_ = java.util.Collections.unmodifiableList(contents_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.contents_ = contents_; + } else { + result.contents_ = contentsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse) { + return mergeFrom((com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse other) { + if (other == com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse.getDefaultInstance()) return this; + if (other.hasBaseRes()) { + mergeBaseRes(other.getBaseRes()); + } + if (contentsBuilder_ == null) { + if (!other.contents_.isEmpty()) { + if (contents_.isEmpty()) { + contents_ = other.contents_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureContentsIsMutable(); + contents_.addAll(other.contents_); + } + onChanged(); + } + } else { + if (!other.contents_.isEmpty()) { + if (contentsBuilder_.isEmpty()) { + contentsBuilder_.dispose(); + contentsBuilder_ = null; + contents_ = other.contents_; + bitField0_ = (bitField0_ & ~0x00000002); + contentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getContentsFieldBuilder() : null; + } else { + contentsBuilder_.addAllMessages(other.contents_); + } + } + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse baseRes_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder> baseResBuilder_; + /** + * optional .api.BaseResponse base_res = 1; + */ + public boolean hasBaseRes() { + return baseResBuilder_ != null || baseRes_ != null; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse getBaseRes() { + if (baseResBuilder_ == null) { + return baseRes_ == null ? com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.getDefaultInstance() : baseRes_; + } else { + return baseResBuilder_.getMessage(); + } + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public Builder setBaseRes(com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse value) { + if (baseResBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + baseRes_ = value; + onChanged(); + } else { + baseResBuilder_.setMessage(value); + } + + return this; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public Builder setBaseRes( + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder builderForValue) { + if (baseResBuilder_ == null) { + baseRes_ = builderForValue.build(); + onChanged(); + } else { + baseResBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public Builder mergeBaseRes(com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse value) { + if (baseResBuilder_ == null) { + if (baseRes_ != null) { + baseRes_ = + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.newBuilder(baseRes_).mergeFrom(value).buildPartial(); + } else { + baseRes_ = value; + } + onChanged(); + } else { + baseResBuilder_.mergeFrom(value); + } + + return this; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public Builder clearBaseRes() { + if (baseResBuilder_ == null) { + baseRes_ = null; + onChanged(); + } else { + baseRes_ = null; + baseResBuilder_ = null; + } + + return this; + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder getBaseResBuilder() { + + onChanged(); + return getBaseResFieldBuilder().getBuilder(); + } + /** + * optional .api.BaseResponse base_res = 1; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder getBaseResOrBuilder() { + if (baseResBuilder_ != null) { + return baseResBuilder_.getMessageOrBuilder(); + } else { + return baseRes_ == null ? + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.getDefaultInstance() : baseRes_; + } + } + /** + * optional .api.BaseResponse base_res = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder> + getBaseResFieldBuilder() { + if (baseResBuilder_ == null) { + baseResBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponse.Builder, com.github.wenweihu86.distmq.client.api.BrokerMessage.BaseResponseOrBuilder>( + getBaseRes(), + getParentForChildren(), + isClean()); + baseRes_ = null; + } + return baseResBuilder_; + } + + private java.util.List contents_ = + java.util.Collections.emptyList(); + private void ensureContentsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + contents_ = new java.util.ArrayList(contents_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.Builder, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContentOrBuilder> contentsBuilder_; + + /** + * repeated .api.MessageContent contents = 2; + */ + public java.util.List getContentsList() { + if (contentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(contents_); + } else { + return contentsBuilder_.getMessageList(); + } + } + /** + * repeated .api.MessageContent contents = 2; + */ + public int getContentsCount() { + if (contentsBuilder_ == null) { + return contents_.size(); + } else { + return contentsBuilder_.getCount(); + } + } + /** + * repeated .api.MessageContent contents = 2; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent getContents(int index) { + if (contentsBuilder_ == null) { + return contents_.get(index); + } else { + return contentsBuilder_.getMessage(index); + } + } + /** + * repeated .api.MessageContent contents = 2; + */ + public Builder setContents( + int index, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.set(index, value); + onChanged(); + } else { + contentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .api.MessageContent contents = 2; + */ + public Builder setContents( + int index, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.set(index, builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .api.MessageContent contents = 2; + */ + public Builder addContents(com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.add(value); + onChanged(); + } else { + contentsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .api.MessageContent contents = 2; + */ + public Builder addContents( + int index, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.add(index, value); + onChanged(); + } else { + contentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .api.MessageContent contents = 2; + */ + public Builder addContents( + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .api.MessageContent contents = 2; + */ + public Builder addContents( + int index, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(index, builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .api.MessageContent contents = 2; + */ + public Builder addAllContents( + java.lang.Iterable values) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, contents_); + onChanged(); + } else { + contentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .api.MessageContent contents = 2; + */ + public Builder clearContents() { + if (contentsBuilder_ == null) { + contents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + contentsBuilder_.clear(); + } + return this; + } + /** + * repeated .api.MessageContent contents = 2; + */ + public Builder removeContents(int index) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.remove(index); + onChanged(); + } else { + contentsBuilder_.remove(index); + } + return this; + } + /** + * repeated .api.MessageContent contents = 2; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.Builder getContentsBuilder( + int index) { + return getContentsFieldBuilder().getBuilder(index); + } + /** + * repeated .api.MessageContent contents = 2; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContentOrBuilder getContentsOrBuilder( + int index) { + if (contentsBuilder_ == null) { + return contents_.get(index); } else { + return contentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .api.MessageContent contents = 2; + */ + public java.util.List + getContentsOrBuilderList() { + if (contentsBuilder_ != null) { + return contentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(contents_); + } + } + /** + * repeated .api.MessageContent contents = 2; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.Builder addContentsBuilder() { + return getContentsFieldBuilder().addBuilder( + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.getDefaultInstance()); + } + /** + * repeated .api.MessageContent contents = 2; + */ + public com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.Builder addContentsBuilder( + int index) { + return getContentsFieldBuilder().addBuilder( + index, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.getDefaultInstance()); + } + /** + * repeated .api.MessageContent contents = 2; + */ + public java.util.List + getContentsBuilderList() { + return getContentsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.Builder, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContentOrBuilder> + getContentsFieldBuilder() { + if (contentsBuilder_ == null) { + contentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContent.Builder, com.github.wenweihu86.distmq.client.api.BrokerMessage.MessageContentOrBuilder>( + contents_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + contents_ = null; + } + return contentsBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:api.PullMessageResponse) + } + + // @@protoc_insertion_point(class_scope:api.PullMessageResponse) + private static final com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse(); + } + + public static com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PullMessageResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PullMessageResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.github.wenweihu86.distmq.client.api.BrokerMessage.PullMessageResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_api_BaseResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_api_BaseResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_api_MessageContent_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_api_MessageContent_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_api_SendMessageRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_api_SendMessageRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_api_SendMessageResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_api_SendMessageResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_api_PullMessageRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_api_PullMessageRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_api_PullMessageResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_api_PullMessageResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014broker.proto\022\003api\"?\n\014BaseResponse\022\036\n\010r" + + "es_code\030\001 \001(\0162\014.api.ResCode\022\017\n\007res_msg\030\002" + + " \001(\t\"O\n\016MessageContent\022\r\n\005topic\030\001 \001(\t\022\r\n" + + "\005queue\030\002 \001(\005\022\016\n\006offset\030\003 \001(\003\022\017\n\007content\030" + + "\004 \001(\014\"C\n\022SendMessageRequest\022\r\n\005topic\030\001 \001" + + "(\t\022\r\n\005queue\030\002 \001(\005\022\017\n\007content\030\003 \001(\014\":\n\023Se" + + "ndMessageResponse\022#\n\010base_res\030\001 \001(\0132\021.ap" + + "i.BaseResponse\"a\n\022PullMessageRequest\022\r\n\005" + + "topic\030\001 \001(\t\022\r\n\005queue\030\002 \001(\005\022\026\n\016consumer_g" + + "roup\030\003 \001(\t\022\025\n\rmessage_count\030\004 \001(\005\"a\n\023Pul", + "lMessageResponse\022#\n\010base_res\030\001 \001(\0132\021.api" + + ".BaseResponse\022%\n\010contents\030\002 \003(\0132\023.api.Me" + + "ssageContent*2\n\007ResCode\022\024\n\020RES_CODE_SUCC" + + "ESS\020\000\022\021\n\rRES_CODE_FAIL\020\001B8\n\'com.github.w" + + "enweihu86.distmq.client.apiB\rBrokerMessa" + + "geb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_api_BaseResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_api_BaseResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_api_BaseResponse_descriptor, + new java.lang.String[] { "ResCode", "ResMsg", }); + internal_static_api_MessageContent_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_api_MessageContent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_api_MessageContent_descriptor, + new java.lang.String[] { "Topic", "Queue", "Offset", "Content", }); + internal_static_api_SendMessageRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_api_SendMessageRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_api_SendMessageRequest_descriptor, + new java.lang.String[] { "Topic", "Queue", "Content", }); + internal_static_api_SendMessageResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_api_SendMessageResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_api_SendMessageResponse_descriptor, + new java.lang.String[] { "BaseRes", }); + internal_static_api_PullMessageRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_api_PullMessageRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_api_PullMessageRequest_descriptor, + new java.lang.String[] { "Topic", "Queue", "ConsumerGroup", "MessageCount", }); + internal_static_api_PullMessageResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_api_PullMessageResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_api_PullMessageResponse_descriptor, + new java.lang.String[] { "BaseRes", "Contents", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/distmq-client/src/main/java/com/github/wenweihu86/distmq/client/api/broker.proto b/distmq-client/src/main/java/com/github/wenweihu86/distmq/client/api/broker.proto new file mode 100644 index 0000000..c97a4a9 --- /dev/null +++ b/distmq-client/src/main/java/com/github/wenweihu86/distmq/client/api/broker.proto @@ -0,0 +1,44 @@ +syntax="proto3"; + +package api; +option java_package = "com.github.wenweihu86.distmq.client.api"; +option java_outer_classname = "BrokerMessage"; + +enum ResCode { + RES_CODE_SUCCESS = 0; + RES_CODE_FAIL = 1; +} + +message BaseResponse { + ResCode res_code = 1; + string res_msg = 2; +} + +message MessageContent { + string topic = 1; + int32 queue = 2; + int64 offset = 3; + bytes content = 4; +} + +message SendMessageRequest { + string topic = 1; + int32 queue = 2; + bytes content = 3; +} + +message SendMessageResponse { + BaseResponse base_res = 1; +} + +message PullMessageRequest { + string topic = 1; + int32 queue = 2; + string consumer_group = 3; + int32 message_count = 4; +} + +message PullMessageResponse { + BaseResponse base_res = 1; + repeated MessageContent contents = 2; +}