diff --git a/cim-client-sdk/cim-android-sdk/pom.xml b/cim-client-sdk/cim-android-sdk/pom.xml index de84791..a0ae289 100755 --- a/cim-client-sdk/cim-android-sdk/pom.xml +++ b/cim-client-sdk/cim-android-sdk/pom.xml @@ -6,7 +6,7 @@ com.farsunset cim-android-sdk - 4.2.12 + 4.2.13 jar ${project.groupId}:${project.artifactId} @@ -29,17 +29,18 @@ UTF-8 UTF-8 1.8 - 3.0.1 + 3.22.0 com.google.protobuf - protobuf-lite - ${protobuf.lite.version} + protobuf-javalite + 3.22.0 + android android diff --git a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/coder/ClientMessageDecoder.java b/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/coder/ClientMessageDecoder.java index 6eefd0d..678f53a 100644 --- a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/coder/ClientMessageDecoder.java +++ b/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/coder/ClientMessageDecoder.java @@ -77,7 +77,7 @@ public class ClientMessageDecoder { } if (ProtobufType.REPLY_BODY == type) { - ReplyBodyProto.Model bodyProto = ReplyBodyProto.Model.parseFrom(bodyBuffer.array()); + ReplyBodyProto.ReplyModel bodyProto = ReplyBodyProto.ReplyModel.parseFrom(bodyBuffer.array()); ReplyBody body = new ReplyBody(); body.setKey(bodyProto.getKey()); body.setTimestamp(bodyProto.getTimestamp()); @@ -87,7 +87,7 @@ public class ClientMessageDecoder { return body; } - MessageProto.Model bodyProto = MessageProto.Model.parseFrom(bodyBuffer.array()); + MessageProto.MessageModel bodyProto = MessageProto.MessageModel.parseFrom(bodyBuffer.array()); Message message = new Message(); message.setId(bodyProto.getId()); message.setAction(bodyProto.getAction()); diff --git a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/SentBody.java b/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/SentBody.java index 63ebc7d..2308f1d 100644 --- a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/SentBody.java +++ b/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/SentBody.java @@ -97,7 +97,7 @@ public class SentBody implements Serializable, BinaryBody { @Override public byte[] getByteArray() { - SentBodyProto.Model.Builder builder = SentBodyProto.Model.newBuilder(); + SentBodyProto.SentModel.Builder builder = SentBodyProto.SentModel.newBuilder(); builder.setKey(key); builder.setTimestamp(timestamp); if (!data.isEmpty()) { diff --git a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/MessageProto.java b/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/MessageProto.java index 5f2195e..640e11c 100644 --- a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/MessageProto.java +++ b/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/MessageProto.java @@ -8,99 +8,115 @@ public final class MessageProto { public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } - public interface ModelOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.Model) + public interface MessageModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.MessageModel) com.google.protobuf.MessageLiteOrBuilder { /** - * optional int64 id = 1; + * int64 id = 1; + * @return The id. */ long getId(); /** - * optional string action = 2; + * string action = 2; + * @return The action. */ String getAction(); /** - * optional string action = 2; + * string action = 2; + * @return The bytes for action. */ com.google.protobuf.ByteString getActionBytes(); /** - * optional string content = 3; + * string content = 3; + * @return The content. */ String getContent(); /** - * optional string content = 3; + * string content = 3; + * @return The bytes for content. */ com.google.protobuf.ByteString getContentBytes(); /** - * optional string sender = 4; + * string sender = 4; + * @return The sender. */ String getSender(); /** - * optional string sender = 4; + * string sender = 4; + * @return The bytes for sender. */ com.google.protobuf.ByteString getSenderBytes(); /** - * optional string receiver = 5; + * string receiver = 5; + * @return The receiver. */ String getReceiver(); /** - * optional string receiver = 5; + * string receiver = 5; + * @return The bytes for receiver. */ com.google.protobuf.ByteString getReceiverBytes(); /** - * optional string extra = 6; + * string extra = 6; + * @return The extra. */ String getExtra(); /** - * optional string extra = 6; + * string extra = 6; + * @return The bytes for extra. */ com.google.protobuf.ByteString getExtraBytes(); /** - * optional string title = 7; + * string title = 7; + * @return The title. */ String getTitle(); /** - * optional string title = 7; + * string title = 7; + * @return The bytes for title. */ com.google.protobuf.ByteString getTitleBytes(); /** - * optional string format = 8; + * string format = 8; + * @return The format. */ String getFormat(); /** - * optional string format = 8; + * string format = 8; + * @return The bytes for format. */ com.google.protobuf.ByteString getFormatBytes(); /** - * optional int64 timestamp = 9; + * int64 timestamp = 9; + * @return The timestamp. */ long getTimestamp(); } /** - * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.MessageModel} */ - public static final class Model extends + public static final class MessageModel extends com.google.protobuf.GeneratedMessageLite< - Model, Model.Builder> implements - // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.Model) - ModelOrBuilder { - private Model() { + MessageModel, MessageModel.Builder> implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.MessageModel) + MessageModelOrBuilder { + private MessageModel() { action_ = ""; content_ = ""; sender_ = ""; @@ -112,20 +128,23 @@ public final class MessageProto { public static final int ID_FIELD_NUMBER = 1; private long id_; /** - * optional int64 id = 1; + * int64 id = 1; + * @return The id. */ + @Override public long getId() { return id_; } /** - * optional int64 id = 1; + * int64 id = 1; + * @param value The id to set. */ private void setId(long value) { id_ = value; } /** - * optional int64 id = 1; + * int64 id = 1; */ private void clearId() { @@ -135,478 +154,425 @@ public final class MessageProto { public static final int ACTION_FIELD_NUMBER = 2; private String action_; /** - * optional string action = 2; + * string action = 2; + * @return The action. */ + @Override public String getAction() { return action_; } /** - * optional string action = 2; + * string action = 2; + * @return The bytes for action. */ + @Override public com.google.protobuf.ByteString getActionBytes() { return com.google.protobuf.ByteString.copyFromUtf8(action_); } /** - * optional string action = 2; + * string action = 2; + * @param value The action to set. */ private void setAction( String value) { - if (value == null) { - throw new NullPointerException(); - } + Class valueClass = value.getClass(); action_ = value; } /** - * optional string action = 2; + * string action = 2; */ private void clearAction() { action_ = getDefaultInstance().getAction(); } /** - * optional string action = 2; + * string action = 2; + * @param value The bytes for action to set. */ private void setActionBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + checkByteStringIsUtf8(value); action_ = value.toStringUtf8(); + } public static final int CONTENT_FIELD_NUMBER = 3; private String content_; /** - * optional string content = 3; + * string content = 3; + * @return The content. */ + @Override public String getContent() { return content_; } /** - * optional string content = 3; + * string content = 3; + * @return The bytes for content. */ + @Override public com.google.protobuf.ByteString getContentBytes() { return com.google.protobuf.ByteString.copyFromUtf8(content_); } /** - * optional string content = 3; + * string content = 3; + * @param value The content to set. */ private void setContent( String value) { - if (value == null) { - throw new NullPointerException(); - } + Class valueClass = value.getClass(); content_ = value; } /** - * optional string content = 3; + * string content = 3; */ private void clearContent() { content_ = getDefaultInstance().getContent(); } /** - * optional string content = 3; + * string content = 3; + * @param value The bytes for content to set. */ private void setContentBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + checkByteStringIsUtf8(value); content_ = value.toStringUtf8(); + } public static final int SENDER_FIELD_NUMBER = 4; private String sender_; /** - * optional string sender = 4; + * string sender = 4; + * @return The sender. */ + @Override public String getSender() { return sender_; } /** - * optional string sender = 4; + * string sender = 4; + * @return The bytes for sender. */ + @Override public com.google.protobuf.ByteString getSenderBytes() { return com.google.protobuf.ByteString.copyFromUtf8(sender_); } /** - * optional string sender = 4; + * string sender = 4; + * @param value The sender to set. */ private void setSender( String value) { - if (value == null) { - throw new NullPointerException(); - } + Class valueClass = value.getClass(); sender_ = value; } /** - * optional string sender = 4; + * string sender = 4; */ private void clearSender() { sender_ = getDefaultInstance().getSender(); } /** - * optional string sender = 4; + * string sender = 4; + * @param value The bytes for sender to set. */ private void setSenderBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + checkByteStringIsUtf8(value); sender_ = value.toStringUtf8(); + } public static final int RECEIVER_FIELD_NUMBER = 5; private String receiver_; /** - * optional string receiver = 5; + * string receiver = 5; + * @return The receiver. */ + @Override public String getReceiver() { return receiver_; } /** - * optional string receiver = 5; + * string receiver = 5; + * @return The bytes for receiver. */ + @Override public com.google.protobuf.ByteString getReceiverBytes() { return com.google.protobuf.ByteString.copyFromUtf8(receiver_); } /** - * optional string receiver = 5; + * string receiver = 5; + * @param value The receiver to set. */ private void setReceiver( String value) { - if (value == null) { - throw new NullPointerException(); - } + Class valueClass = value.getClass(); receiver_ = value; } /** - * optional string receiver = 5; + * string receiver = 5; */ private void clearReceiver() { receiver_ = getDefaultInstance().getReceiver(); } /** - * optional string receiver = 5; + * string receiver = 5; + * @param value The bytes for receiver to set. */ private void setReceiverBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + checkByteStringIsUtf8(value); receiver_ = value.toStringUtf8(); + } public static final int EXTRA_FIELD_NUMBER = 6; private String extra_; /** - * optional string extra = 6; + * string extra = 6; + * @return The extra. */ + @Override public String getExtra() { return extra_; } /** - * optional string extra = 6; + * string extra = 6; + * @return The bytes for extra. */ + @Override public com.google.protobuf.ByteString getExtraBytes() { return com.google.protobuf.ByteString.copyFromUtf8(extra_); } /** - * optional string extra = 6; + * string extra = 6; + * @param value The extra to set. */ private void setExtra( String value) { - if (value == null) { - throw new NullPointerException(); - } + Class valueClass = value.getClass(); extra_ = value; } /** - * optional string extra = 6; + * string extra = 6; */ private void clearExtra() { extra_ = getDefaultInstance().getExtra(); } /** - * optional string extra = 6; + * string extra = 6; + * @param value The bytes for extra to set. */ private void setExtraBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + checkByteStringIsUtf8(value); extra_ = value.toStringUtf8(); + } public static final int TITLE_FIELD_NUMBER = 7; private String title_; /** - * optional string title = 7; + * string title = 7; + * @return The title. */ + @Override public String getTitle() { return title_; } /** - * optional string title = 7; + * string title = 7; + * @return The bytes for title. */ + @Override public com.google.protobuf.ByteString getTitleBytes() { return com.google.protobuf.ByteString.copyFromUtf8(title_); } /** - * optional string title = 7; + * string title = 7; + * @param value The title to set. */ private void setTitle( String value) { - if (value == null) { - throw new NullPointerException(); - } + Class valueClass = value.getClass(); title_ = value; } /** - * optional string title = 7; + * string title = 7; */ private void clearTitle() { title_ = getDefaultInstance().getTitle(); } /** - * optional string title = 7; + * string title = 7; + * @param value The bytes for title to set. */ private void setTitleBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + checkByteStringIsUtf8(value); title_ = value.toStringUtf8(); + } public static final int FORMAT_FIELD_NUMBER = 8; private String format_; /** - * optional string format = 8; + * string format = 8; + * @return The format. */ + @Override public String getFormat() { return format_; } /** - * optional string format = 8; + * string format = 8; + * @return The bytes for format. */ + @Override public com.google.protobuf.ByteString getFormatBytes() { return com.google.protobuf.ByteString.copyFromUtf8(format_); } /** - * optional string format = 8; + * string format = 8; + * @param value The format to set. */ private void setFormat( String value) { - if (value == null) { - throw new NullPointerException(); - } + Class valueClass = value.getClass(); format_ = value; } /** - * optional string format = 8; + * string format = 8; */ private void clearFormat() { format_ = getDefaultInstance().getFormat(); } /** - * optional string format = 8; + * string format = 8; + * @param value The bytes for format to set. */ private void setFormatBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + checkByteStringIsUtf8(value); format_ = value.toStringUtf8(); + } public static final int TIMESTAMP_FIELD_NUMBER = 9; private long timestamp_; /** - * optional int64 timestamp = 9; + * int64 timestamp = 9; + * @return The timestamp. */ + @Override public long getTimestamp() { return timestamp_; } /** - * optional int64 timestamp = 9; + * int64 timestamp = 9; + * @param value The timestamp to set. */ private void setTimestamp(long value) { timestamp_ = value; } /** - * optional int64 timestamp = 9; + * int64 timestamp = 9; */ private void clearTimestamp() { timestamp_ = 0L; } - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (id_ != 0L) { - output.writeInt64(1, id_); - } - if (!action_.isEmpty()) { - output.writeString(2, getAction()); - } - if (!content_.isEmpty()) { - output.writeString(3, getContent()); - } - if (!sender_.isEmpty()) { - output.writeString(4, getSender()); - } - if (!receiver_.isEmpty()) { - output.writeString(5, getReceiver()); - } - if (!extra_.isEmpty()) { - output.writeString(6, getExtra()); - } - if (!title_.isEmpty()) { - output.writeString(7, getTitle()); - } - if (!format_.isEmpty()) { - output.writeString(8, getFormat()); - } - if (timestamp_ != 0L) { - output.writeInt64(9, timestamp_); - } + public static MessageModel parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, id_); - } - if (!action_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(2, getAction()); - } - if (!content_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(3, getContent()); - } - if (!sender_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(4, getSender()); - } - if (!receiver_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(5, getReceiver()); - } - if (!extra_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(6, getExtra()); - } - if (!title_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(7, getTitle()); - } - if (!format_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(8, getFormat()); - } - if (timestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(9, timestamp_); - } - memoizedSerializedSize = size; - return size; + public static MessageModel parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); } - - public static Model parseFrom( + public static MessageModel parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static Model parseFrom( + public static MessageModel parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static Model parseFrom(byte[] data) + public static MessageModel parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static Model parseFrom( + public static MessageModel parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static Model parseFrom(java.io.InputStream input) + public static MessageModel parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static Model parseFrom( + public static MessageModel parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input, extensionRegistry); } - public static Model parseDelimitedFrom(java.io.InputStream input) + public static MessageModel parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input); } - public static Model parseDelimitedFrom( + public static MessageModel parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); } - public static Model parseFrom( + public static MessageModel parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static Model parseFrom( + public static MessageModel parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -615,34 +581,38 @@ public final class MessageProto { } public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); + return (Builder) DEFAULT_INSTANCE.createBuilder(); } - public static Builder newBuilder(Model prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + public static Builder newBuilder(MessageModel prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); } /** - * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.MessageModel} */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - Model, Builder> implements - // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.Model) - ModelOrBuilder { - // Construct using com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.newBuilder() + MessageModel, Builder> implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.MessageModel) + MessageModelOrBuilder { + // Construct using com.farsunset.cim.sdk.android.model.proto.MessageProto.MessageModel.newBuilder() private Builder() { super(DEFAULT_INSTANCE); } /** - * optional int64 id = 1; + * int64 id = 1; + * @return The id. */ + @Override public long getId() { return instance.getId(); } /** - * optional int64 id = 1; + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. */ public Builder setId(long value) { copyOnWrite(); @@ -650,7 +620,8 @@ public final class MessageProto { return this; } /** - * optional int64 id = 1; + * int64 id = 1; + * @return This builder for chaining. */ public Builder clearId() { copyOnWrite(); @@ -659,20 +630,26 @@ public final class MessageProto { } /** - * optional string action = 2; + * string action = 2; + * @return The action. */ + @Override public String getAction() { return instance.getAction(); } /** - * optional string action = 2; + * string action = 2; + * @return The bytes for action. */ + @Override public com.google.protobuf.ByteString getActionBytes() { return instance.getActionBytes(); } /** - * optional string action = 2; + * string action = 2; + * @param value The action to set. + * @return This builder for chaining. */ public Builder setAction( String value) { @@ -681,7 +658,8 @@ public final class MessageProto { return this; } /** - * optional string action = 2; + * string action = 2; + * @return This builder for chaining. */ public Builder clearAction() { copyOnWrite(); @@ -689,7 +667,9 @@ public final class MessageProto { return this; } /** - * optional string action = 2; + * string action = 2; + * @param value The bytes for action to set. + * @return This builder for chaining. */ public Builder setActionBytes( com.google.protobuf.ByteString value) { @@ -699,20 +679,26 @@ public final class MessageProto { } /** - * optional string content = 3; + * string content = 3; + * @return The content. */ + @Override public String getContent() { return instance.getContent(); } /** - * optional string content = 3; + * string content = 3; + * @return The bytes for content. */ + @Override public com.google.protobuf.ByteString getContentBytes() { return instance.getContentBytes(); } /** - * optional string content = 3; + * string content = 3; + * @param value The content to set. + * @return This builder for chaining. */ public Builder setContent( String value) { @@ -721,7 +707,8 @@ public final class MessageProto { return this; } /** - * optional string content = 3; + * string content = 3; + * @return This builder for chaining. */ public Builder clearContent() { copyOnWrite(); @@ -729,7 +716,9 @@ public final class MessageProto { return this; } /** - * optional string content = 3; + * string content = 3; + * @param value The bytes for content to set. + * @return This builder for chaining. */ public Builder setContentBytes( com.google.protobuf.ByteString value) { @@ -739,20 +728,26 @@ public final class MessageProto { } /** - * optional string sender = 4; + * string sender = 4; + * @return The sender. */ + @Override public String getSender() { return instance.getSender(); } /** - * optional string sender = 4; + * string sender = 4; + * @return The bytes for sender. */ + @Override public com.google.protobuf.ByteString getSenderBytes() { return instance.getSenderBytes(); } /** - * optional string sender = 4; + * string sender = 4; + * @param value The sender to set. + * @return This builder for chaining. */ public Builder setSender( String value) { @@ -761,7 +756,8 @@ public final class MessageProto { return this; } /** - * optional string sender = 4; + * string sender = 4; + * @return This builder for chaining. */ public Builder clearSender() { copyOnWrite(); @@ -769,7 +765,9 @@ public final class MessageProto { return this; } /** - * optional string sender = 4; + * string sender = 4; + * @param value The bytes for sender to set. + * @return This builder for chaining. */ public Builder setSenderBytes( com.google.protobuf.ByteString value) { @@ -779,20 +777,26 @@ public final class MessageProto { } /** - * optional string receiver = 5; + * string receiver = 5; + * @return The receiver. */ + @Override public String getReceiver() { return instance.getReceiver(); } /** - * optional string receiver = 5; + * string receiver = 5; + * @return The bytes for receiver. */ + @Override public com.google.protobuf.ByteString getReceiverBytes() { return instance.getReceiverBytes(); } /** - * optional string receiver = 5; + * string receiver = 5; + * @param value The receiver to set. + * @return This builder for chaining. */ public Builder setReceiver( String value) { @@ -801,7 +805,8 @@ public final class MessageProto { return this; } /** - * optional string receiver = 5; + * string receiver = 5; + * @return This builder for chaining. */ public Builder clearReceiver() { copyOnWrite(); @@ -809,7 +814,9 @@ public final class MessageProto { return this; } /** - * optional string receiver = 5; + * string receiver = 5; + * @param value The bytes for receiver to set. + * @return This builder for chaining. */ public Builder setReceiverBytes( com.google.protobuf.ByteString value) { @@ -819,20 +826,26 @@ public final class MessageProto { } /** - * optional string extra = 6; + * string extra = 6; + * @return The extra. */ + @Override public String getExtra() { return instance.getExtra(); } /** - * optional string extra = 6; + * string extra = 6; + * @return The bytes for extra. */ + @Override public com.google.protobuf.ByteString getExtraBytes() { return instance.getExtraBytes(); } /** - * optional string extra = 6; + * string extra = 6; + * @param value The extra to set. + * @return This builder for chaining. */ public Builder setExtra( String value) { @@ -841,7 +854,8 @@ public final class MessageProto { return this; } /** - * optional string extra = 6; + * string extra = 6; + * @return This builder for chaining. */ public Builder clearExtra() { copyOnWrite(); @@ -849,7 +863,9 @@ public final class MessageProto { return this; } /** - * optional string extra = 6; + * string extra = 6; + * @param value The bytes for extra to set. + * @return This builder for chaining. */ public Builder setExtraBytes( com.google.protobuf.ByteString value) { @@ -859,20 +875,26 @@ public final class MessageProto { } /** - * optional string title = 7; + * string title = 7; + * @return The title. */ + @Override public String getTitle() { return instance.getTitle(); } /** - * optional string title = 7; + * string title = 7; + * @return The bytes for title. */ + @Override public com.google.protobuf.ByteString getTitleBytes() { return instance.getTitleBytes(); } /** - * optional string title = 7; + * string title = 7; + * @param value The title to set. + * @return This builder for chaining. */ public Builder setTitle( String value) { @@ -881,7 +903,8 @@ public final class MessageProto { return this; } /** - * optional string title = 7; + * string title = 7; + * @return This builder for chaining. */ public Builder clearTitle() { copyOnWrite(); @@ -889,7 +912,9 @@ public final class MessageProto { return this; } /** - * optional string title = 7; + * string title = 7; + * @param value The bytes for title to set. + * @return This builder for chaining. */ public Builder setTitleBytes( com.google.protobuf.ByteString value) { @@ -899,20 +924,26 @@ public final class MessageProto { } /** - * optional string format = 8; + * string format = 8; + * @return The format. */ + @Override public String getFormat() { return instance.getFormat(); } /** - * optional string format = 8; + * string format = 8; + * @return The bytes for format. */ + @Override public com.google.protobuf.ByteString getFormatBytes() { return instance.getFormatBytes(); } /** - * optional string format = 8; + * string format = 8; + * @param value The format to set. + * @return This builder for chaining. */ public Builder setFormat( String value) { @@ -921,7 +952,8 @@ public final class MessageProto { return this; } /** - * optional string format = 8; + * string format = 8; + * @return This builder for chaining. */ public Builder clearFormat() { copyOnWrite(); @@ -929,7 +961,9 @@ public final class MessageProto { return this; } /** - * optional string format = 8; + * string format = 8; + * @param value The bytes for format to set. + * @return This builder for chaining. */ public Builder setFormatBytes( com.google.protobuf.ByteString value) { @@ -939,13 +973,17 @@ public final class MessageProto { } /** - * optional int64 timestamp = 9; + * int64 timestamp = 9; + * @return The timestamp. */ + @Override public long getTimestamp() { return instance.getTimestamp(); } /** - * optional int64 timestamp = 9; + * int64 timestamp = 9; + * @param value The timestamp to set. + * @return This builder for chaining. */ public Builder setTimestamp(long value) { copyOnWrite(); @@ -953,7 +991,8 @@ public final class MessageProto { return this; } /** - * optional int64 timestamp = 9; + * int64 timestamp = 9; + * @return This builder for chaining. */ public Builder clearTimestamp() { copyOnWrite(); @@ -961,163 +1000,85 @@ public final class MessageProto { return this; } - // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.Model) + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.MessageModel) } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) protected final Object dynamicMethod( MethodToInvoke method, Object arg0, Object arg1) { switch (method) { case NEW_MUTABLE_INSTANCE: { - return new Model(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - return null; + return new MessageModel(); } case NEW_BUILDER: { return new Builder(); } - case VISIT: { - Visitor visitor = (Visitor) arg0; - Model other = (Model) arg1; - id_ = visitor.visitLong(id_ != 0L, id_, - other.id_ != 0L, other.id_); - action_ = visitor.visitString(!action_.isEmpty(), action_, - !other.action_.isEmpty(), other.action_); - content_ = visitor.visitString(!content_.isEmpty(), content_, - !other.content_.isEmpty(), other.content_); - sender_ = visitor.visitString(!sender_.isEmpty(), sender_, - !other.sender_.isEmpty(), other.sender_); - receiver_ = visitor.visitString(!receiver_.isEmpty(), receiver_, - !other.receiver_.isEmpty(), other.receiver_); - extra_ = visitor.visitString(!extra_.isEmpty(), extra_, - !other.extra_.isEmpty(), other.extra_); - title_ = visitor.visitString(!title_.isEmpty(), title_, - !other.title_.isEmpty(), other.title_); - format_ = visitor.visitString(!format_.isEmpty(), format_, - !other.format_.isEmpty(), other.format_); - timestamp_ = visitor.visitLong(timestamp_ != 0L, timestamp_, - other.timestamp_ != 0L, other.timestamp_); - if (visitor == MergeFromVisitor - .INSTANCE) { - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - 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: { - - id_ = input.readInt64(); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - action_ = s; - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - - content_ = s; - break; - } - case 34: { - String s = input.readStringRequireUtf8(); - - sender_ = s; - break; - } - case 42: { - String s = input.readStringRequireUtf8(); - - receiver_ = s; - break; - } - case 50: { - String s = input.readStringRequireUtf8(); - - extra_ = s; - break; - } - case 58: { - String s = input.readStringRequireUtf8(); - - title_ = s; - break; - } - case 66: { - String s = input.readStringRequireUtf8(); - - format_ = s; - break; - } - case 72: { - - timestamp_ = input.readInt64(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "id_", + "action_", + "content_", + "sender_", + "receiver_", + "extra_", + "title_", + "format_", + "timestamp_", + }; + String info = + "\u0000\t\u0000\u0000\u0001\t\t\u0000\u0000\u0000\u0001\u0002\u0002\u0208\u0003\u0208" + + "\u0004\u0208\u0005\u0208\u0006\u0208\u0007\u0208\b\u0208\t\u0002"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); } + // fall through case GET_DEFAULT_INSTANCE: { return DEFAULT_INSTANCE; } case GET_PARSER: { - if (PARSER == null) { synchronized (Model.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (MessageModel.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; } } } - return PARSER; - } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } } throw new UnsupportedOperationException(); } - // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.Model) - private static final Model DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.MessageModel) + private static final MessageModel DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new Model(); - DEFAULT_INSTANCE.makeImmutable(); + MessageModel defaultInstance = new MessageModel(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + MessageModel.class, defaultInstance); } - public static Model getDefaultInstance() { + public static MessageModel getDefaultInstance() { return DEFAULT_INSTANCE; } - private static volatile com.google.protobuf.Parser PARSER; + private static volatile com.google.protobuf.Parser PARSER; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return DEFAULT_INSTANCE.getParserForType(); } } diff --git a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/ReplyBodyProto.java b/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/ReplyBodyProto.java index f06c473..ef52863 100644 --- a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/ReplyBodyProto.java +++ b/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/ReplyBodyProto.java @@ -8,42 +8,49 @@ public final class ReplyBodyProto { public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } - public interface ModelOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.Model) + public interface ReplyModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.ReplyModel) com.google.protobuf.MessageLiteOrBuilder { /** - * optional string key = 1; + * string key = 1; + * @return The key. */ String getKey(); /** - * optional string key = 1; + * string key = 1; + * @return The bytes for key. */ com.google.protobuf.ByteString getKeyBytes(); /** - * optional string code = 2; + * string code = 2; + * @return The code. */ String getCode(); /** - * optional string code = 2; + * string code = 2; + * @return The bytes for code. */ com.google.protobuf.ByteString getCodeBytes(); /** - * optional string message = 3; + * string message = 3; + * @return The message. */ String getMessage(); /** - * optional string message = 3; + * string message = 3; + * @return The bytes for message. */ com.google.protobuf.ByteString getMessageBytes(); /** - * optional int64 timestamp = 4; + * int64 timestamp = 4; + * @return The timestamp. */ long getTimestamp(); @@ -55,7 +62,7 @@ public final class ReplyBodyProto { * map<string, string> data = 5; */ boolean containsData( - String key); + String key); /** * Use {@link #getDataMap()} instead. */ @@ -71,185 +78,192 @@ public final class ReplyBodyProto { * map<string, string> data = 5; */ - String getDataOrDefault( - String key, - String defaultValue); + /* nullable */ +String getDataOrDefault( + String key, + /* nullable */ +String defaultValue); /** * map<string, string> data = 5; */ String getDataOrThrow( - String key); + String key); } /** - * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.ReplyModel} */ - public static final class Model extends + public static final class ReplyModel extends com.google.protobuf.GeneratedMessageLite< - Model, Model.Builder> implements - // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.Model) - ModelOrBuilder { - private Model() { + ReplyModel, ReplyModel.Builder> implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.ReplyModel) + ReplyModelOrBuilder { + private ReplyModel() { key_ = ""; code_ = ""; message_ = ""; } - private int bitField0_; public static final int KEY_FIELD_NUMBER = 1; private String key_; /** - * optional string key = 1; + * string key = 1; + * @return The key. */ + @Override public String getKey() { return key_; } /** - * optional string key = 1; + * string key = 1; + * @return The bytes for key. */ + @Override public com.google.protobuf.ByteString getKeyBytes() { return com.google.protobuf.ByteString.copyFromUtf8(key_); } /** - * optional string key = 1; + * string key = 1; + * @param value The key to set. */ private void setKey( String value) { - if (value == null) { - throw new NullPointerException(); - } + Class valueClass = value.getClass(); key_ = value; } /** - * optional string key = 1; + * string key = 1; */ private void clearKey() { key_ = getDefaultInstance().getKey(); } /** - * optional string key = 1; + * string key = 1; + * @param value The bytes for key to set. */ private void setKeyBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + checkByteStringIsUtf8(value); key_ = value.toStringUtf8(); + } public static final int CODE_FIELD_NUMBER = 2; private String code_; /** - * optional string code = 2; + * string code = 2; + * @return The code. */ + @Override public String getCode() { return code_; } /** - * optional string code = 2; + * string code = 2; + * @return The bytes for code. */ + @Override public com.google.protobuf.ByteString getCodeBytes() { return com.google.protobuf.ByteString.copyFromUtf8(code_); } /** - * optional string code = 2; + * string code = 2; + * @param value The code to set. */ private void setCode( String value) { - if (value == null) { - throw new NullPointerException(); - } + Class valueClass = value.getClass(); code_ = value; } /** - * optional string code = 2; + * string code = 2; */ private void clearCode() { code_ = getDefaultInstance().getCode(); } /** - * optional string code = 2; + * string code = 2; + * @param value The bytes for code to set. */ private void setCodeBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + checkByteStringIsUtf8(value); code_ = value.toStringUtf8(); + } public static final int MESSAGE_FIELD_NUMBER = 3; private String message_; /** - * optional string message = 3; + * string message = 3; + * @return The message. */ + @Override public String getMessage() { return message_; } /** - * optional string message = 3; + * string message = 3; + * @return The bytes for message. */ + @Override public com.google.protobuf.ByteString getMessageBytes() { return com.google.protobuf.ByteString.copyFromUtf8(message_); } /** - * optional string message = 3; + * string message = 3; + * @param value The message to set. */ private void setMessage( String value) { - if (value == null) { - throw new NullPointerException(); - } + Class valueClass = value.getClass(); message_ = value; } /** - * optional string message = 3; + * string message = 3; */ private void clearMessage() { message_ = getDefaultInstance().getMessage(); } /** - * optional string message = 3; + * string message = 3; + * @param value The bytes for message to set. */ private void setMessageBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + checkByteStringIsUtf8(value); message_ = value.toStringUtf8(); + } public static final int TIMESTAMP_FIELD_NUMBER = 4; private long timestamp_; /** - * optional int64 timestamp = 4; + * int64 timestamp = 4; + * @return The timestamp. */ + @Override public long getTimestamp() { return timestamp_; } /** - * optional int64 timestamp = 4; + * int64 timestamp = 4; + * @param value The timestamp to set. */ private void setTimestamp(long value) { timestamp_ = value; } /** - * optional int64 timestamp = 4; + * int64 timestamp = 4; */ private void clearTimestamp() { @@ -281,6 +295,7 @@ public final class ReplyBodyProto { } return data_; } + @Override public int getDataCount() { return internalGetData().size(); @@ -288,15 +303,17 @@ public final class ReplyBodyProto { /** * map<string, string> data = 5; */ + @Override public boolean containsData( String key) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); return internalGetData().containsKey(key); } /** * Use {@link #getDataMap()} instead. */ + @Override @Deprecated public java.util.Map getData() { return getDataMap(); @@ -304,6 +321,7 @@ public final class ReplyBodyProto { /** * map<string, string> data = 5; */ + @Override public java.util.Map getDataMap() { return java.util.Collections.unmodifiableMap( @@ -312,11 +330,12 @@ public final class ReplyBodyProto { /** * map<string, string> data = 5; */ + @Override public String getDataOrDefault( String key, String defaultValue) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); java.util.Map map = internalGetData(); return map.containsKey(key) ? map.get(key) : defaultValue; @@ -324,10 +343,11 @@ public final class ReplyBodyProto { /** * map<string, string> data = 5; */ + @Override public String getDataOrThrow( String key) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); java.util.Map map = internalGetData(); if (!map.containsKey(key)) { @@ -343,111 +363,73 @@ public final class ReplyBodyProto { return internalGetMutableData(); } - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!key_.isEmpty()) { - output.writeString(1, getKey()); - } - if (!code_.isEmpty()) { - output.writeString(2, getCode()); - } - if (!message_.isEmpty()) { - output.writeString(3, getMessage()); - } - if (timestamp_ != 0L) { - output.writeInt64(4, timestamp_); - } - for (java.util.Map.Entry entry - : internalGetData().entrySet()) { - DataDefaultEntryHolder.defaultEntry.serializeTo( - output, 5, entry.getKey(), entry.getValue()); - } + public static ReplyModel parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (!key_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(1, getKey()); - } - if (!code_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(2, getCode()); - } - if (!message_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(3, getMessage()); - } - if (timestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, timestamp_); - } - for (java.util.Map.Entry entry - : internalGetData().entrySet()) { - size += DataDefaultEntryHolder.defaultEntry.computeMessageSize( - 5, entry.getKey(), entry.getValue()); - } - memoizedSerializedSize = size; - return size; + public static ReplyModel parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); } - - public static Model parseFrom( + public static ReplyModel parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static Model parseFrom( + public static ReplyModel parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static Model parseFrom(byte[] data) + public static ReplyModel parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static Model parseFrom( + public static ReplyModel parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static Model parseFrom(java.io.InputStream input) + public static ReplyModel parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static Model parseFrom( + public static ReplyModel parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input, extensionRegistry); } - public static Model parseDelimitedFrom(java.io.InputStream input) + public static ReplyModel parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input); } - public static Model parseDelimitedFrom( + public static ReplyModel parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); } - public static Model parseFrom( + public static ReplyModel parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static Model parseFrom( + public static ReplyModel parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -456,41 +438,47 @@ public final class ReplyBodyProto { } public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); + return (Builder) DEFAULT_INSTANCE.createBuilder(); } - public static Builder newBuilder(Model prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + public static Builder newBuilder(ReplyModel prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); } /** - * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.ReplyModel} */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - Model, Builder> implements - // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.Model) - ModelOrBuilder { - // Construct using com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.newBuilder() + ReplyModel, Builder> implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.ReplyModel) + ReplyModelOrBuilder { + // Construct using com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.ReplyModel.newBuilder() private Builder() { super(DEFAULT_INSTANCE); } /** - * optional string key = 1; + * string key = 1; + * @return The key. */ + @Override public String getKey() { return instance.getKey(); } /** - * optional string key = 1; + * string key = 1; + * @return The bytes for key. */ + @Override public com.google.protobuf.ByteString getKeyBytes() { return instance.getKeyBytes(); } /** - * optional string key = 1; + * string key = 1; + * @param value The key to set. + * @return This builder for chaining. */ public Builder setKey( String value) { @@ -499,7 +487,8 @@ public final class ReplyBodyProto { return this; } /** - * optional string key = 1; + * string key = 1; + * @return This builder for chaining. */ public Builder clearKey() { copyOnWrite(); @@ -507,7 +496,9 @@ public final class ReplyBodyProto { return this; } /** - * optional string key = 1; + * string key = 1; + * @param value The bytes for key to set. + * @return This builder for chaining. */ public Builder setKeyBytes( com.google.protobuf.ByteString value) { @@ -517,20 +508,26 @@ public final class ReplyBodyProto { } /** - * optional string code = 2; + * string code = 2; + * @return The code. */ + @Override public String getCode() { return instance.getCode(); } /** - * optional string code = 2; + * string code = 2; + * @return The bytes for code. */ + @Override public com.google.protobuf.ByteString getCodeBytes() { return instance.getCodeBytes(); } /** - * optional string code = 2; + * string code = 2; + * @param value The code to set. + * @return This builder for chaining. */ public Builder setCode( String value) { @@ -539,7 +536,8 @@ public final class ReplyBodyProto { return this; } /** - * optional string code = 2; + * string code = 2; + * @return This builder for chaining. */ public Builder clearCode() { copyOnWrite(); @@ -547,7 +545,9 @@ public final class ReplyBodyProto { return this; } /** - * optional string code = 2; + * string code = 2; + * @param value The bytes for code to set. + * @return This builder for chaining. */ public Builder setCodeBytes( com.google.protobuf.ByteString value) { @@ -557,20 +557,26 @@ public final class ReplyBodyProto { } /** - * optional string message = 3; + * string message = 3; + * @return The message. */ + @Override public String getMessage() { return instance.getMessage(); } /** - * optional string message = 3; + * string message = 3; + * @return The bytes for message. */ + @Override public com.google.protobuf.ByteString getMessageBytes() { return instance.getMessageBytes(); } /** - * optional string message = 3; + * string message = 3; + * @param value The message to set. + * @return This builder for chaining. */ public Builder setMessage( String value) { @@ -579,7 +585,8 @@ public final class ReplyBodyProto { return this; } /** - * optional string message = 3; + * string message = 3; + * @return This builder for chaining. */ public Builder clearMessage() { copyOnWrite(); @@ -587,7 +594,9 @@ public final class ReplyBodyProto { return this; } /** - * optional string message = 3; + * string message = 3; + * @param value The bytes for message to set. + * @return This builder for chaining. */ public Builder setMessageBytes( com.google.protobuf.ByteString value) { @@ -597,13 +606,17 @@ public final class ReplyBodyProto { } /** - * optional int64 timestamp = 4; + * int64 timestamp = 4; + * @return The timestamp. */ + @Override public long getTimestamp() { return instance.getTimestamp(); } /** - * optional int64 timestamp = 4; + * int64 timestamp = 4; + * @param value The timestamp to set. + * @return This builder for chaining. */ public Builder setTimestamp(long value) { copyOnWrite(); @@ -611,7 +624,8 @@ public final class ReplyBodyProto { return this; } /** - * optional int64 timestamp = 4; + * int64 timestamp = 4; + * @return This builder for chaining. */ public Builder clearTimestamp() { copyOnWrite(); @@ -619,6 +633,7 @@ public final class ReplyBodyProto { return this; } + @Override public int getDataCount() { return instance.getDataMap().size(); @@ -626,10 +641,11 @@ public final class ReplyBodyProto { /** * map<string, string> data = 5; */ + @Override public boolean containsData( String key) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); return instance.getDataMap().containsKey(key); } @@ -644,7 +660,7 @@ public final class ReplyBodyProto { public Builder removeData( String key) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); copyOnWrite(); instance.getMutableDataMap().remove(key); return this; @@ -652,6 +668,7 @@ public final class ReplyBodyProto { /** * Use {@link #getDataMap()} instead. */ + @Override @Deprecated public java.util.Map getData() { return getDataMap(); @@ -659,6 +676,7 @@ public final class ReplyBodyProto { /** * map<string, string> data = 5; */ + @Override public java.util.Map getDataMap() { return java.util.Collections.unmodifiableMap( instance.getDataMap()); @@ -666,11 +684,12 @@ public final class ReplyBodyProto { /** * map<string, string> data = 5; */ + @Override public String getDataOrDefault( String key, String defaultValue) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); java.util.Map map = instance.getDataMap(); return map.containsKey(key) ? map.get(key) : defaultValue; @@ -678,10 +697,11 @@ public final class ReplyBodyProto { /** * map<string, string> data = 5; */ + @Override public String getDataOrThrow( String key) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); java.util.Map map = instance.getDataMap(); if (!map.containsKey(key)) { @@ -695,8 +715,8 @@ public final class ReplyBodyProto { public Builder putData( String key, String value) { - if (key == null) { throw new NullPointerException(); } - if (value == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); + Class valueClass = value.getClass(); copyOnWrite(); instance.getMutableDataMap().put(key, value); return this; @@ -711,134 +731,82 @@ public final class ReplyBodyProto { return this; } - // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.Model) + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.ReplyModel) } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) protected final Object dynamicMethod( MethodToInvoke method, Object arg0, Object arg1) { switch (method) { case NEW_MUTABLE_INSTANCE: { - return new Model(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - data_.makeImmutable(); - return null; + return new ReplyModel(); } case NEW_BUILDER: { return new Builder(); } - case VISIT: { - Visitor visitor = (Visitor) arg0; - Model other = (Model) arg1; - key_ = visitor.visitString(!key_.isEmpty(), key_, - !other.key_.isEmpty(), other.key_); - code_ = visitor.visitString(!code_.isEmpty(), code_, - !other.code_.isEmpty(), other.code_); - message_ = visitor.visitString(!message_.isEmpty(), message_, - !other.message_.isEmpty(), other.message_); - timestamp_ = visitor.visitLong(timestamp_ != 0L, timestamp_, - other.timestamp_ != 0L, other.timestamp_); - data_ = visitor.visitMap( - data_, other.internalGetData()); - if (visitor == MergeFromVisitor - .INSTANCE) { - bitField0_ |= other.bitField0_; - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - 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: { - String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - code_ = s; - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - - message_ = s; - break; - } - case 32: { - - timestamp_ = input.readInt64(); - break; - } - case 42: { - if (!data_.isMutable()) { - data_ = data_.mutableCopy(); - } - DataDefaultEntryHolder.defaultEntry.parseInto(data_, input, extensionRegistry); break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "key_", + "code_", + "message_", + "timestamp_", + "data_", + DataDefaultEntryHolder.defaultEntry, + }; + String info = + "\u0000\u0005\u0000\u0000\u0001\u0005\u0005\u0001\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\u0208\u0004\u0002\u00052"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); } + // fall through case GET_DEFAULT_INSTANCE: { return DEFAULT_INSTANCE; } case GET_PARSER: { - if (PARSER == null) { synchronized (Model.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (ReplyModel.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; } } } - return PARSER; - } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } } throw new UnsupportedOperationException(); } - // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.Model) - private static final Model DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.ReplyModel) + private static final ReplyModel DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new Model(); - DEFAULT_INSTANCE.makeImmutable(); + ReplyModel defaultInstance = new ReplyModel(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ReplyModel.class, defaultInstance); } - public static Model getDefaultInstance() { + public static ReplyModel getDefaultInstance() { return DEFAULT_INSTANCE; } - private static volatile com.google.protobuf.Parser PARSER; + private static volatile com.google.protobuf.Parser PARSER; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return DEFAULT_INSTANCE.getParserForType(); } } diff --git a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/SentBodyProto.java b/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/SentBodyProto.java index 0745929..ab86a91 100644 --- a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/SentBodyProto.java +++ b/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/SentBodyProto.java @@ -8,22 +8,25 @@ public final class SentBodyProto { public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } - public interface ModelOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.Model) + public interface SentModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.SentModel) com.google.protobuf.MessageLiteOrBuilder { /** - * optional string key = 1; + * string key = 1; + * @return The key. */ String getKey(); /** - * optional string key = 1; + * string key = 1; + * @return The bytes for key. */ com.google.protobuf.ByteString getKeyBytes(); /** - * optional int64 timestamp = 2; + * int64 timestamp = 2; + * @return The timestamp. */ long getTimestamp(); @@ -35,7 +38,7 @@ public final class SentBodyProto { * map<string, string> data = 3; */ boolean containsData( - String key); + String key); /** * Use {@link #getDataMap()} instead. */ @@ -51,91 +54,96 @@ public final class SentBodyProto { * map<string, string> data = 3; */ - String getDataOrDefault( - String key, - String defaultValue); + /* nullable */ +String getDataOrDefault( + String key, + /* nullable */ +String defaultValue); /** * map<string, string> data = 3; */ String getDataOrThrow( - String key); + String key); } /** - * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.SentModel} */ - public static final class Model extends + public static final class SentModel extends com.google.protobuf.GeneratedMessageLite< - Model, Model.Builder> implements - // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.Model) - ModelOrBuilder { - private Model() { + SentModel, SentModel.Builder> implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.SentModel) + SentModelOrBuilder { + private SentModel() { key_ = ""; } - private int bitField0_; public static final int KEY_FIELD_NUMBER = 1; private String key_; /** - * optional string key = 1; + * string key = 1; + * @return The key. */ + @Override public String getKey() { return key_; } /** - * optional string key = 1; + * string key = 1; + * @return The bytes for key. */ + @Override public com.google.protobuf.ByteString getKeyBytes() { return com.google.protobuf.ByteString.copyFromUtf8(key_); } /** - * optional string key = 1; + * string key = 1; + * @param value The key to set. */ private void setKey( String value) { - if (value == null) { - throw new NullPointerException(); - } + Class valueClass = value.getClass(); key_ = value; } /** - * optional string key = 1; + * string key = 1; */ private void clearKey() { key_ = getDefaultInstance().getKey(); } /** - * optional string key = 1; + * string key = 1; + * @param value The bytes for key to set. */ private void setKeyBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + checkByteStringIsUtf8(value); key_ = value.toStringUtf8(); + } public static final int TIMESTAMP_FIELD_NUMBER = 2; private long timestamp_; /** - * optional int64 timestamp = 2; + * int64 timestamp = 2; + * @return The timestamp. */ + @Override public long getTimestamp() { return timestamp_; } /** - * optional int64 timestamp = 2; + * int64 timestamp = 2; + * @param value The timestamp to set. */ private void setTimestamp(long value) { timestamp_ = value; } /** - * optional int64 timestamp = 2; + * int64 timestamp = 2; */ private void clearTimestamp() { @@ -167,6 +175,7 @@ public final class SentBodyProto { } return data_; } + @Override public int getDataCount() { return internalGetData().size(); @@ -174,15 +183,17 @@ public final class SentBodyProto { /** * map<string, string> data = 3; */ + @Override public boolean containsData( String key) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); return internalGetData().containsKey(key); } /** * Use {@link #getDataMap()} instead. */ + @Override @Deprecated public java.util.Map getData() { return getDataMap(); @@ -190,6 +201,7 @@ public final class SentBodyProto { /** * map<string, string> data = 3; */ + @Override public java.util.Map getDataMap() { return java.util.Collections.unmodifiableMap( @@ -198,11 +210,12 @@ public final class SentBodyProto { /** * map<string, string> data = 3; */ + @Override public String getDataOrDefault( String key, String defaultValue) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); java.util.Map map = internalGetData(); return map.containsKey(key) ? map.get(key) : defaultValue; @@ -210,10 +223,11 @@ public final class SentBodyProto { /** * map<string, string> data = 3; */ + @Override public String getDataOrThrow( String key) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); java.util.Map map = internalGetData(); if (!map.containsKey(key)) { @@ -229,97 +243,73 @@ public final class SentBodyProto { return internalGetMutableData(); } - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!key_.isEmpty()) { - output.writeString(1, getKey()); - } - if (timestamp_ != 0L) { - output.writeInt64(2, timestamp_); - } - for (java.util.Map.Entry entry - : internalGetData().entrySet()) { - DataDefaultEntryHolder.defaultEntry.serializeTo( - output, 3, entry.getKey(), entry.getValue()); - } + public static SentModel parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (!key_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(1, getKey()); - } - if (timestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, timestamp_); - } - for (java.util.Map.Entry entry - : internalGetData().entrySet()) { - size += DataDefaultEntryHolder.defaultEntry.computeMessageSize( - 3, entry.getKey(), entry.getValue()); - } - memoizedSerializedSize = size; - return size; + public static SentModel parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); } - - public static Model parseFrom( + public static SentModel parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static Model parseFrom( + public static SentModel parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static Model parseFrom(byte[] data) + public static SentModel parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static Model parseFrom( + public static SentModel parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static Model parseFrom(java.io.InputStream input) + public static SentModel parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static Model parseFrom( + public static SentModel parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input, extensionRegistry); } - public static Model parseDelimitedFrom(java.io.InputStream input) + public static SentModel parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input); } - public static Model parseDelimitedFrom( + public static SentModel parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); } - public static Model parseFrom( + public static SentModel parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static Model parseFrom( + public static SentModel parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -328,41 +318,47 @@ public final class SentBodyProto { } public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); + return (Builder) DEFAULT_INSTANCE.createBuilder(); } - public static Builder newBuilder(Model prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + public static Builder newBuilder(SentModel prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); } /** - * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.SentModel} */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - Model, Builder> implements - // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.Model) - ModelOrBuilder { - // Construct using com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.newBuilder() + SentModel, Builder> implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.SentModel) + SentModelOrBuilder { + // Construct using com.farsunset.cim.sdk.android.model.proto.SentBodyProto.SentModel.newBuilder() private Builder() { super(DEFAULT_INSTANCE); } /** - * optional string key = 1; + * string key = 1; + * @return The key. */ + @Override public String getKey() { return instance.getKey(); } /** - * optional string key = 1; + * string key = 1; + * @return The bytes for key. */ + @Override public com.google.protobuf.ByteString getKeyBytes() { return instance.getKeyBytes(); } /** - * optional string key = 1; + * string key = 1; + * @param value The key to set. + * @return This builder for chaining. */ public Builder setKey( String value) { @@ -371,7 +367,8 @@ public final class SentBodyProto { return this; } /** - * optional string key = 1; + * string key = 1; + * @return This builder for chaining. */ public Builder clearKey() { copyOnWrite(); @@ -379,7 +376,9 @@ public final class SentBodyProto { return this; } /** - * optional string key = 1; + * string key = 1; + * @param value The bytes for key to set. + * @return This builder for chaining. */ public Builder setKeyBytes( com.google.protobuf.ByteString value) { @@ -389,13 +388,17 @@ public final class SentBodyProto { } /** - * optional int64 timestamp = 2; + * int64 timestamp = 2; + * @return The timestamp. */ + @Override public long getTimestamp() { return instance.getTimestamp(); } /** - * optional int64 timestamp = 2; + * int64 timestamp = 2; + * @param value The timestamp to set. + * @return This builder for chaining. */ public Builder setTimestamp(long value) { copyOnWrite(); @@ -403,7 +406,8 @@ public final class SentBodyProto { return this; } /** - * optional int64 timestamp = 2; + * int64 timestamp = 2; + * @return This builder for chaining. */ public Builder clearTimestamp() { copyOnWrite(); @@ -411,6 +415,7 @@ public final class SentBodyProto { return this; } + @Override public int getDataCount() { return instance.getDataMap().size(); @@ -418,10 +423,11 @@ public final class SentBodyProto { /** * map<string, string> data = 3; */ + @Override public boolean containsData( String key) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); return instance.getDataMap().containsKey(key); } @@ -436,7 +442,7 @@ public final class SentBodyProto { public Builder removeData( String key) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); copyOnWrite(); instance.getMutableDataMap().remove(key); return this; @@ -444,6 +450,7 @@ public final class SentBodyProto { /** * Use {@link #getDataMap()} instead. */ + @Override @Deprecated public java.util.Map getData() { return getDataMap(); @@ -451,6 +458,7 @@ public final class SentBodyProto { /** * map<string, string> data = 3; */ + @Override public java.util.Map getDataMap() { return java.util.Collections.unmodifiableMap( instance.getDataMap()); @@ -458,11 +466,12 @@ public final class SentBodyProto { /** * map<string, string> data = 3; */ + @Override public String getDataOrDefault( String key, String defaultValue) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); java.util.Map map = instance.getDataMap(); return map.containsKey(key) ? map.get(key) : defaultValue; @@ -470,10 +479,11 @@ public final class SentBodyProto { /** * map<string, string> data = 3; */ + @Override public String getDataOrThrow( String key) { - if (key == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); java.util.Map map = instance.getDataMap(); if (!map.containsKey(key)) { @@ -487,8 +497,8 @@ public final class SentBodyProto { public Builder putData( String key, String value) { - if (key == null) { throw new NullPointerException(); } - if (value == null) { throw new NullPointerException(); } + Class keyClass = key.getClass(); + Class valueClass = value.getClass(); copyOnWrite(); instance.getMutableDataMap().put(key, value); return this; @@ -503,118 +513,80 @@ public final class SentBodyProto { return this; } - // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.Model) + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.SentModel) } + @Override + @SuppressWarnings({"unchecked", "fallthrough"}) protected final Object dynamicMethod( MethodToInvoke method, Object arg0, Object arg1) { switch (method) { case NEW_MUTABLE_INSTANCE: { - return new Model(); - } - case IS_INITIALIZED: { - return DEFAULT_INSTANCE; - } - case MAKE_IMMUTABLE: { - data_.makeImmutable(); - return null; + return new SentModel(); } case NEW_BUILDER: { return new Builder(); } - case VISIT: { - Visitor visitor = (Visitor) arg0; - Model other = (Model) arg1; - key_ = visitor.visitString(!key_.isEmpty(), key_, - !other.key_.isEmpty(), other.key_); - timestamp_ = visitor.visitLong(timestamp_ != 0L, timestamp_, - other.timestamp_ != 0L, other.timestamp_); - data_ = visitor.visitMap( - data_, other.internalGetData()); - if (visitor == MergeFromVisitor - .INSTANCE) { - bitField0_ |= other.bitField0_; - } - return this; - } - case MERGE_FROM_STREAM: { - com.google.protobuf.CodedInputStream input = - (com.google.protobuf.CodedInputStream) arg0; - com.google.protobuf.ExtensionRegistryLite extensionRegistry = - (com.google.protobuf.ExtensionRegistryLite) arg1; - 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: { - String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 16: { - - timestamp_ = input.readInt64(); - break; - } - case 26: { - if (!data_.isMutable()) { - data_ = data_.mutableCopy(); - } - DataDefaultEntryHolder.defaultEntry.parseInto(data_, input, extensionRegistry); break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - } + case BUILD_MESSAGE_INFO: { + Object[] objects = new Object[] { + "key_", + "timestamp_", + "data_", + DataDefaultEntryHolder.defaultEntry, + }; + String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0001\u0000\u0000\u0001\u0208\u0002\u0002" + + "\u00032"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); } + // fall through case GET_DEFAULT_INSTANCE: { return DEFAULT_INSTANCE; } case GET_PARSER: { - if (PARSER == null) { synchronized (Model.class) { - if (PARSER == null) { - PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (SentModel.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; } } } - return PARSER; - } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } } throw new UnsupportedOperationException(); } - // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.Model) - private static final Model DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.SentModel) + private static final SentModel DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new Model(); - DEFAULT_INSTANCE.makeImmutable(); + SentModel defaultInstance = new SentModel(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SentModel.class, defaultInstance); } - public static Model getDefaultInstance() { + public static SentModel getDefaultInstance() { return DEFAULT_INSTANCE; } - private static volatile com.google.protobuf.Parser PARSER; + private static volatile com.google.protobuf.Parser PARSER; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return DEFAULT_INSTANCE.getParserForType(); } } diff --git a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/Message.proto b/cim-client-sdk/cim-android-sdk/src/main/proto/Message.proto similarity index 92% rename from cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/Message.proto rename to cim-client-sdk/cim-android-sdk/src/main/proto/Message.proto index 7426bd6..e5ff0ba 100644 --- a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/Message.proto +++ b/cim-client-sdk/cim-android-sdk/src/main/proto/Message.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package com.farsunset.cim.sdk.android.model.proto; option java_outer_classname = "MessageProto"; -message Model { +message MessageModel { int64 id = 1; string action = 2; string content = 3; diff --git a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/ReplyBody.proto b/cim-client-sdk/cim-android-sdk/src/main/proto/ReplyBody.proto similarity index 91% rename from cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/ReplyBody.proto rename to cim-client-sdk/cim-android-sdk/src/main/proto/ReplyBody.proto index 7e091c6..29ccc18 100644 --- a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/ReplyBody.proto +++ b/cim-client-sdk/cim-android-sdk/src/main/proto/ReplyBody.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package com.farsunset.cim.sdk.android.model.proto; option java_outer_classname = "ReplyBodyProto"; -message Model { +message ReplyModel { string key = 1; string code = 2; string message = 3; diff --git a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/SentBody.proto b/cim-client-sdk/cim-android-sdk/src/main/proto/SentBody.proto similarity index 90% rename from cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/SentBody.proto rename to cim-client-sdk/cim-android-sdk/src/main/proto/SentBody.proto index abc4096..15959ba 100644 --- a/cim-client-sdk/cim-android-sdk/src/main/java/com/farsunset/cim/sdk/android/model/proto/SentBody.proto +++ b/cim-client-sdk/cim-android-sdk/src/main/proto/SentBody.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package com.farsunset.cim.sdk.android.model.proto; option java_outer_classname = "SentBodyProto"; -message Model { +message SentModel { string key = 1; int64 timestamp = 2; map data = 3;