修改Android sdk 替换protobuf-lite为protobuf-javalite

This commit is contained in:
远方夕阳 2023-12-04 19:02:08 +08:00
parent 43308baa5f
commit e60f64ec55
9 changed files with 733 additions and 831 deletions

View File

@ -6,7 +6,7 @@
<groupId>com.farsunset</groupId> <groupId>com.farsunset</groupId>
<artifactId>cim-android-sdk</artifactId> <artifactId>cim-android-sdk</artifactId>
<version>4.2.12</version> <version>4.2.13</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>${project.groupId}:${project.artifactId}</name> <name>${project.groupId}:${project.artifactId}</name>
@ -29,17 +29,18 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<protobuf.lite.version>3.0.1</protobuf.lite.version> <google.protobuf.version>3.22.0</google.protobuf.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.google.protobuf</groupId> <groupId>com.google.protobuf</groupId>
<artifactId>protobuf-lite</artifactId> <artifactId>protobuf-javalite</artifactId>
<version>${protobuf.lite.version}</version> <version>3.22.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>android</groupId> <groupId>android</groupId>
<artifactId>android</artifactId> <artifactId>android</artifactId>

View File

@ -77,7 +77,7 @@ public class ClientMessageDecoder {
} }
if (ProtobufType.REPLY_BODY == type) { 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(); ReplyBody body = new ReplyBody();
body.setKey(bodyProto.getKey()); body.setKey(bodyProto.getKey());
body.setTimestamp(bodyProto.getTimestamp()); body.setTimestamp(bodyProto.getTimestamp());
@ -87,7 +87,7 @@ public class ClientMessageDecoder {
return body; return body;
} }
MessageProto.Model bodyProto = MessageProto.Model.parseFrom(bodyBuffer.array()); MessageProto.MessageModel bodyProto = MessageProto.MessageModel.parseFrom(bodyBuffer.array());
Message message = new Message(); Message message = new Message();
message.setId(bodyProto.getId()); message.setId(bodyProto.getId());
message.setAction(bodyProto.getAction()); message.setAction(bodyProto.getAction());

View File

@ -97,7 +97,7 @@ public class SentBody implements Serializable, BinaryBody {
@Override @Override
public byte[] getByteArray() { public byte[] getByteArray() {
SentBodyProto.Model.Builder builder = SentBodyProto.Model.newBuilder(); SentBodyProto.SentModel.Builder builder = SentBodyProto.SentModel.newBuilder();
builder.setKey(key); builder.setKey(key);
builder.setTimestamp(timestamp); builder.setTimestamp(timestamp);
if (!data.isEmpty()) { if (!data.isEmpty()) {

View File

@ -8,42 +8,49 @@ public final class ReplyBodyProto {
public static void registerAllExtensions( public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) { com.google.protobuf.ExtensionRegistryLite registry) {
} }
public interface ModelOrBuilder extends public interface ReplyModelOrBuilder extends
// @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.Model) // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.ReplyModel)
com.google.protobuf.MessageLiteOrBuilder { com.google.protobuf.MessageLiteOrBuilder {
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The key.
*/ */
String getKey(); String getKey();
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The bytes for key.
*/ */
com.google.protobuf.ByteString com.google.protobuf.ByteString
getKeyBytes(); getKeyBytes();
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
* @return The code.
*/ */
String getCode(); String getCode();
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
* @return The bytes for code.
*/ */
com.google.protobuf.ByteString com.google.protobuf.ByteString
getCodeBytes(); getCodeBytes();
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
* @return The message.
*/ */
String getMessage(); String getMessage();
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
* @return The bytes for message.
*/ */
com.google.protobuf.ByteString com.google.protobuf.ByteString
getMessageBytes(); getMessageBytes();
/** /**
* <code>optional int64 timestamp = 4;</code> * <code>int64 timestamp = 4;</code>
* @return The timestamp.
*/ */
long getTimestamp(); long getTimestamp();
@ -71,8 +78,10 @@ public final class ReplyBodyProto {
* <code>map&lt;string, string&gt; data = 5;</code> * <code>map&lt;string, string&gt; data = 5;</code>
*/ */
/* nullable */
String getDataOrDefault( String getDataOrDefault(
String key, String key,
/* nullable */
String defaultValue); String defaultValue);
/** /**
* <code>map&lt;string, string&gt; data = 5;</code> * <code>map&lt;string, string&gt; data = 5;</code>
@ -82,174 +91,179 @@ public final class ReplyBodyProto {
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< com.google.protobuf.GeneratedMessageLite<
Model, Model.Builder> implements ReplyModel, ReplyModel.Builder> implements
// @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.Model) // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.ReplyModel)
ModelOrBuilder { ReplyModelOrBuilder {
private Model() { private ReplyModel() {
key_ = ""; key_ = "";
code_ = ""; code_ = "";
message_ = ""; message_ = "";
} }
private int bitField0_;
public static final int KEY_FIELD_NUMBER = 1; public static final int KEY_FIELD_NUMBER = 1;
private String key_; private String key_;
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The key.
*/ */
@Override
public String getKey() { public String getKey() {
return key_; return key_;
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The bytes for key.
*/ */
@Override
public com.google.protobuf.ByteString public com.google.protobuf.ByteString
getKeyBytes() { getKeyBytes() {
return com.google.protobuf.ByteString.copyFromUtf8(key_); return com.google.protobuf.ByteString.copyFromUtf8(key_);
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @param value The key to set.
*/ */
private void setKey( private void setKey(
String value) { String value) {
if (value == null) { Class<?> valueClass = value.getClass();
throw new NullPointerException();
}
key_ = value; key_ = value;
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
*/ */
private void clearKey() { private void clearKey() {
key_ = getDefaultInstance().getKey(); key_ = getDefaultInstance().getKey();
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @param value The bytes for key to set.
*/ */
private void setKeyBytes( private void setKeyBytes(
com.google.protobuf.ByteString value) { com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value); checkByteStringIsUtf8(value);
key_ = value.toStringUtf8(); key_ = value.toStringUtf8();
} }
public static final int CODE_FIELD_NUMBER = 2; public static final int CODE_FIELD_NUMBER = 2;
private String code_; private String code_;
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
* @return The code.
*/ */
@Override
public String getCode() { public String getCode() {
return code_; return code_;
} }
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
* @return The bytes for code.
*/ */
@Override
public com.google.protobuf.ByteString public com.google.protobuf.ByteString
getCodeBytes() { getCodeBytes() {
return com.google.protobuf.ByteString.copyFromUtf8(code_); return com.google.protobuf.ByteString.copyFromUtf8(code_);
} }
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
* @param value The code to set.
*/ */
private void setCode( private void setCode(
String value) { String value) {
if (value == null) { Class<?> valueClass = value.getClass();
throw new NullPointerException();
}
code_ = value; code_ = value;
} }
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
*/ */
private void clearCode() { private void clearCode() {
code_ = getDefaultInstance().getCode(); code_ = getDefaultInstance().getCode();
} }
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
* @param value The bytes for code to set.
*/ */
private void setCodeBytes( private void setCodeBytes(
com.google.protobuf.ByteString value) { com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value); checkByteStringIsUtf8(value);
code_ = value.toStringUtf8(); code_ = value.toStringUtf8();
} }
public static final int MESSAGE_FIELD_NUMBER = 3; public static final int MESSAGE_FIELD_NUMBER = 3;
private String message_; private String message_;
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
* @return The message.
*/ */
@Override
public String getMessage() { public String getMessage() {
return message_; return message_;
} }
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
* @return The bytes for message.
*/ */
@Override
public com.google.protobuf.ByteString public com.google.protobuf.ByteString
getMessageBytes() { getMessageBytes() {
return com.google.protobuf.ByteString.copyFromUtf8(message_); return com.google.protobuf.ByteString.copyFromUtf8(message_);
} }
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
* @param value The message to set.
*/ */
private void setMessage( private void setMessage(
String value) { String value) {
if (value == null) { Class<?> valueClass = value.getClass();
throw new NullPointerException();
}
message_ = value; message_ = value;
} }
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
*/ */
private void clearMessage() { private void clearMessage() {
message_ = getDefaultInstance().getMessage(); message_ = getDefaultInstance().getMessage();
} }
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
* @param value The bytes for message to set.
*/ */
private void setMessageBytes( private void setMessageBytes(
com.google.protobuf.ByteString value) { com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value); checkByteStringIsUtf8(value);
message_ = value.toStringUtf8(); message_ = value.toStringUtf8();
} }
public static final int TIMESTAMP_FIELD_NUMBER = 4; public static final int TIMESTAMP_FIELD_NUMBER = 4;
private long timestamp_; private long timestamp_;
/** /**
* <code>optional int64 timestamp = 4;</code> * <code>int64 timestamp = 4;</code>
* @return The timestamp.
*/ */
@Override
public long getTimestamp() { public long getTimestamp() {
return timestamp_; return timestamp_;
} }
/** /**
* <code>optional int64 timestamp = 4;</code> * <code>int64 timestamp = 4;</code>
* @param value The timestamp to set.
*/ */
private void setTimestamp(long value) { private void setTimestamp(long value) {
timestamp_ = value; timestamp_ = value;
} }
/** /**
* <code>optional int64 timestamp = 4;</code> * <code>int64 timestamp = 4;</code>
*/ */
private void clearTimestamp() { private void clearTimestamp() {
@ -281,6 +295,7 @@ public final class ReplyBodyProto {
} }
return data_; return data_;
} }
@Override
public int getDataCount() { public int getDataCount() {
return internalGetData().size(); return internalGetData().size();
@ -288,15 +303,17 @@ public final class ReplyBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 5;</code> * <code>map&lt;string, string&gt; data = 5;</code>
*/ */
@Override
public boolean containsData( public boolean containsData(
String key) { String key) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
return internalGetData().containsKey(key); return internalGetData().containsKey(key);
} }
/** /**
* Use {@link #getDataMap()} instead. * Use {@link #getDataMap()} instead.
*/ */
@Override
@Deprecated @Deprecated
public java.util.Map<String, String> getData() { public java.util.Map<String, String> getData() {
return getDataMap(); return getDataMap();
@ -304,6 +321,7 @@ public final class ReplyBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 5;</code> * <code>map&lt;string, string&gt; data = 5;</code>
*/ */
@Override
public java.util.Map<String, String> getDataMap() { public java.util.Map<String, String> getDataMap() {
return java.util.Collections.unmodifiableMap( return java.util.Collections.unmodifiableMap(
@ -312,11 +330,12 @@ public final class ReplyBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 5;</code> * <code>map&lt;string, string&gt; data = 5;</code>
*/ */
@Override
public String getDataOrDefault( public String getDataOrDefault(
String key, String key,
String defaultValue) { String defaultValue) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
java.util.Map<String, String> map = java.util.Map<String, String> map =
internalGetData(); internalGetData();
return map.containsKey(key) ? map.get(key) : defaultValue; return map.containsKey(key) ? map.get(key) : defaultValue;
@ -324,10 +343,11 @@ public final class ReplyBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 5;</code> * <code>map&lt;string, string&gt; data = 5;</code>
*/ */
@Override
public String getDataOrThrow( public String getDataOrThrow(
String key) { String key) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
java.util.Map<String, String> map = java.util.Map<String, String> map =
internalGetData(); internalGetData();
if (!map.containsKey(key)) { if (!map.containsKey(key)) {
@ -343,111 +363,73 @@ public final class ReplyBodyProto {
return internalGetMutableData(); return internalGetMutableData();
} }
public void writeTo(com.google.protobuf.CodedOutputStream output) public static ReplyModel parseFrom(
throws java.io.IOException { java.nio.ByteBuffer data)
if (!key_.isEmpty()) { throws com.google.protobuf.InvalidProtocolBufferException {
output.writeString(1, getKey()); return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
} }
if (!code_.isEmpty()) { public static ReplyModel parseFrom(
output.writeString(2, getCode()); java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
} }
if (!message_.isEmpty()) { public static ReplyModel parseFrom(
output.writeString(3, getMessage());
}
if (timestamp_ != 0L) {
output.writeInt64(4, timestamp_);
}
for (java.util.Map.Entry<String, String> entry
: internalGetData().entrySet()) {
DataDefaultEntryHolder.defaultEntry.serializeTo(
output, 5, entry.getKey(), entry.getValue());
}
}
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<String, String> entry
: internalGetData().entrySet()) {
size += DataDefaultEntryHolder.defaultEntry.computeMessageSize(
5, entry.getKey(), entry.getValue());
}
memoizedSerializedSize = size;
return size;
}
public static Model parseFrom(
com.google.protobuf.ByteString data) com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data); DEFAULT_INSTANCE, data);
} }
public static Model parseFrom( public static ReplyModel parseFrom(
com.google.protobuf.ByteString data, com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry); DEFAULT_INSTANCE, data, extensionRegistry);
} }
public static Model parseFrom(byte[] data) public static ReplyModel parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data); DEFAULT_INSTANCE, data);
} }
public static Model parseFrom( public static ReplyModel parseFrom(
byte[] data, byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry); DEFAULT_INSTANCE, data, extensionRegistry);
} }
public static Model parseFrom(java.io.InputStream input) public static ReplyModel parseFrom(java.io.InputStream input)
throws java.io.IOException { throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input); DEFAULT_INSTANCE, input);
} }
public static Model parseFrom( public static ReplyModel parseFrom(
java.io.InputStream input, java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException { throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input, extensionRegistry); DEFAULT_INSTANCE, input, extensionRegistry);
} }
public static Model parseDelimitedFrom(java.io.InputStream input) public static ReplyModel parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException { throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input); return parseDelimitedFrom(DEFAULT_INSTANCE, input);
} }
public static Model parseDelimitedFrom( public static ReplyModel parseDelimitedFrom(
java.io.InputStream input, java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException { throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
} }
public static Model parseFrom( public static ReplyModel parseFrom(
com.google.protobuf.CodedInputStream input) com.google.protobuf.CodedInputStream input)
throws java.io.IOException { throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input); DEFAULT_INSTANCE, input);
} }
public static Model parseFrom( public static ReplyModel parseFrom(
com.google.protobuf.CodedInputStream input, com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException { throws java.io.IOException {
@ -456,41 +438,47 @@ public final class ReplyBodyProto {
} }
public static Builder newBuilder() { public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder(); return (Builder) DEFAULT_INSTANCE.createBuilder();
} }
public static Builder newBuilder(Model prototype) { public static Builder newBuilder(ReplyModel prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(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 public static final class Builder extends
com.google.protobuf.GeneratedMessageLite.Builder< com.google.protobuf.GeneratedMessageLite.Builder<
Model, Builder> implements ReplyModel, Builder> implements
// @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.Model) // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.ReplyModel)
ModelOrBuilder { ReplyModelOrBuilder {
// Construct using com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.newBuilder() // Construct using com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.ReplyModel.newBuilder()
private Builder() { private Builder() {
super(DEFAULT_INSTANCE); super(DEFAULT_INSTANCE);
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The key.
*/ */
@Override
public String getKey() { public String getKey() {
return instance.getKey(); return instance.getKey();
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The bytes for key.
*/ */
@Override
public com.google.protobuf.ByteString public com.google.protobuf.ByteString
getKeyBytes() { getKeyBytes() {
return instance.getKeyBytes(); return instance.getKeyBytes();
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @param value The key to set.
* @return This builder for chaining.
*/ */
public Builder setKey( public Builder setKey(
String value) { String value) {
@ -499,7 +487,8 @@ public final class ReplyBodyProto {
return this; return this;
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return This builder for chaining.
*/ */
public Builder clearKey() { public Builder clearKey() {
copyOnWrite(); copyOnWrite();
@ -507,7 +496,9 @@ public final class ReplyBodyProto {
return this; return this;
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @param value The bytes for key to set.
* @return This builder for chaining.
*/ */
public Builder setKeyBytes( public Builder setKeyBytes(
com.google.protobuf.ByteString value) { com.google.protobuf.ByteString value) {
@ -517,20 +508,26 @@ public final class ReplyBodyProto {
} }
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
* @return The code.
*/ */
@Override
public String getCode() { public String getCode() {
return instance.getCode(); return instance.getCode();
} }
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
* @return The bytes for code.
*/ */
@Override
public com.google.protobuf.ByteString public com.google.protobuf.ByteString
getCodeBytes() { getCodeBytes() {
return instance.getCodeBytes(); return instance.getCodeBytes();
} }
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
* @param value The code to set.
* @return This builder for chaining.
*/ */
public Builder setCode( public Builder setCode(
String value) { String value) {
@ -539,7 +536,8 @@ public final class ReplyBodyProto {
return this; return this;
} }
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
* @return This builder for chaining.
*/ */
public Builder clearCode() { public Builder clearCode() {
copyOnWrite(); copyOnWrite();
@ -547,7 +545,9 @@ public final class ReplyBodyProto {
return this; return this;
} }
/** /**
* <code>optional string code = 2;</code> * <code>string code = 2;</code>
* @param value The bytes for code to set.
* @return This builder for chaining.
*/ */
public Builder setCodeBytes( public Builder setCodeBytes(
com.google.protobuf.ByteString value) { com.google.protobuf.ByteString value) {
@ -557,20 +557,26 @@ public final class ReplyBodyProto {
} }
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
* @return The message.
*/ */
@Override
public String getMessage() { public String getMessage() {
return instance.getMessage(); return instance.getMessage();
} }
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
* @return The bytes for message.
*/ */
@Override
public com.google.protobuf.ByteString public com.google.protobuf.ByteString
getMessageBytes() { getMessageBytes() {
return instance.getMessageBytes(); return instance.getMessageBytes();
} }
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
* @param value The message to set.
* @return This builder for chaining.
*/ */
public Builder setMessage( public Builder setMessage(
String value) { String value) {
@ -579,7 +585,8 @@ public final class ReplyBodyProto {
return this; return this;
} }
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
* @return This builder for chaining.
*/ */
public Builder clearMessage() { public Builder clearMessage() {
copyOnWrite(); copyOnWrite();
@ -587,7 +594,9 @@ public final class ReplyBodyProto {
return this; return this;
} }
/** /**
* <code>optional string message = 3;</code> * <code>string message = 3;</code>
* @param value The bytes for message to set.
* @return This builder for chaining.
*/ */
public Builder setMessageBytes( public Builder setMessageBytes(
com.google.protobuf.ByteString value) { com.google.protobuf.ByteString value) {
@ -597,13 +606,17 @@ public final class ReplyBodyProto {
} }
/** /**
* <code>optional int64 timestamp = 4;</code> * <code>int64 timestamp = 4;</code>
* @return The timestamp.
*/ */
@Override
public long getTimestamp() { public long getTimestamp() {
return instance.getTimestamp(); return instance.getTimestamp();
} }
/** /**
* <code>optional int64 timestamp = 4;</code> * <code>int64 timestamp = 4;</code>
* @param value The timestamp to set.
* @return This builder for chaining.
*/ */
public Builder setTimestamp(long value) { public Builder setTimestamp(long value) {
copyOnWrite(); copyOnWrite();
@ -611,7 +624,8 @@ public final class ReplyBodyProto {
return this; return this;
} }
/** /**
* <code>optional int64 timestamp = 4;</code> * <code>int64 timestamp = 4;</code>
* @return This builder for chaining.
*/ */
public Builder clearTimestamp() { public Builder clearTimestamp() {
copyOnWrite(); copyOnWrite();
@ -619,6 +633,7 @@ public final class ReplyBodyProto {
return this; return this;
} }
@Override
public int getDataCount() { public int getDataCount() {
return instance.getDataMap().size(); return instance.getDataMap().size();
@ -626,10 +641,11 @@ public final class ReplyBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 5;</code> * <code>map&lt;string, string&gt; data = 5;</code>
*/ */
@Override
public boolean containsData( public boolean containsData(
String key) { String key) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
return instance.getDataMap().containsKey(key); return instance.getDataMap().containsKey(key);
} }
@ -644,7 +660,7 @@ public final class ReplyBodyProto {
public Builder removeData( public Builder removeData(
String key) { String key) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
copyOnWrite(); copyOnWrite();
instance.getMutableDataMap().remove(key); instance.getMutableDataMap().remove(key);
return this; return this;
@ -652,6 +668,7 @@ public final class ReplyBodyProto {
/** /**
* Use {@link #getDataMap()} instead. * Use {@link #getDataMap()} instead.
*/ */
@Override
@Deprecated @Deprecated
public java.util.Map<String, String> getData() { public java.util.Map<String, String> getData() {
return getDataMap(); return getDataMap();
@ -659,6 +676,7 @@ public final class ReplyBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 5;</code> * <code>map&lt;string, string&gt; data = 5;</code>
*/ */
@Override
public java.util.Map<String, String> getDataMap() { public java.util.Map<String, String> getDataMap() {
return java.util.Collections.unmodifiableMap( return java.util.Collections.unmodifiableMap(
instance.getDataMap()); instance.getDataMap());
@ -666,11 +684,12 @@ public final class ReplyBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 5;</code> * <code>map&lt;string, string&gt; data = 5;</code>
*/ */
@Override
public String getDataOrDefault( public String getDataOrDefault(
String key, String key,
String defaultValue) { String defaultValue) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
java.util.Map<String, String> map = java.util.Map<String, String> map =
instance.getDataMap(); instance.getDataMap();
return map.containsKey(key) ? map.get(key) : defaultValue; return map.containsKey(key) ? map.get(key) : defaultValue;
@ -678,10 +697,11 @@ public final class ReplyBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 5;</code> * <code>map&lt;string, string&gt; data = 5;</code>
*/ */
@Override
public String getDataOrThrow( public String getDataOrThrow(
String key) { String key) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
java.util.Map<String, String> map = java.util.Map<String, String> map =
instance.getDataMap(); instance.getDataMap();
if (!map.containsKey(key)) { if (!map.containsKey(key)) {
@ -695,8 +715,8 @@ public final class ReplyBodyProto {
public Builder putData( public Builder putData(
String key, String key,
String value) { String value) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
if (value == null) { throw new NullPointerException(); } Class<?> valueClass = value.getClass();
copyOnWrite(); copyOnWrite();
instance.getMutableDataMap().put(key, value); instance.getMutableDataMap().put(key, value);
return this; return this;
@ -711,134 +731,82 @@ public final class ReplyBodyProto {
return this; 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( protected final Object dynamicMethod(
MethodToInvoke method, MethodToInvoke method,
Object arg0, Object arg1) { Object arg0, Object arg1) {
switch (method) { switch (method) {
case NEW_MUTABLE_INSTANCE: { case NEW_MUTABLE_INSTANCE: {
return new Model(); return new ReplyModel();
}
case IS_INITIALIZED: {
return DEFAULT_INSTANCE;
}
case MAKE_IMMUTABLE: {
data_.makeImmutable();
return null;
} }
case NEW_BUILDER: { case NEW_BUILDER: {
return new Builder(); return new Builder();
} }
case VISIT: { case BUILD_MESSAGE_INFO: {
Visitor visitor = (Visitor) arg0; Object[] objects = new Object[] {
Model other = (Model) arg1; "key_",
key_ = visitor.visitString(!key_.isEmpty(), key_, "code_",
!other.key_.isEmpty(), other.key_); "message_",
code_ = visitor.visitString(!code_.isEmpty(), code_, "timestamp_",
!other.code_.isEmpty(), other.code_); "data_",
message_ = visitor.visitString(!message_.isEmpty(), message_, DataDefaultEntryHolder.defaultEntry,
!other.message_.isEmpty(), other.message_); };
timestamp_ = visitor.visitLong(timestamp_ != 0L, timestamp_, String info =
other.timestamp_ != 0L, other.timestamp_); "\u0000\u0005\u0000\u0000\u0001\u0005\u0005\u0001\u0000\u0000\u0001\u0208\u0002\u0208" +
data_ = visitor.visitMap( "\u0003\u0208\u0004\u0002\u00052";
data_, other.internalGetData()); return newMessageInfo(DEFAULT_INSTANCE, info, objects);
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 {
}
} }
// fall through
case GET_DEFAULT_INSTANCE: { case GET_DEFAULT_INSTANCE: {
return DEFAULT_INSTANCE; return DEFAULT_INSTANCE;
} }
case GET_PARSER: { case GET_PARSER: {
if (PARSER == null) { synchronized (Model.class) { com.google.protobuf.Parser<ReplyModel> parser = PARSER;
if (PARSER == null) { if (parser == null) {
PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); synchronized (ReplyModel.class) {
parser = PARSER;
if (parser == null) {
parser =
new DefaultInstanceBasedParser<ReplyModel>(
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(); throw new UnsupportedOperationException();
} }
// @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.Model) // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.ReplyModel)
private static final Model DEFAULT_INSTANCE; private static final ReplyModel DEFAULT_INSTANCE;
static { static {
DEFAULT_INSTANCE = new Model(); ReplyModel defaultInstance = new ReplyModel();
DEFAULT_INSTANCE.makeImmutable(); // 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; return DEFAULT_INSTANCE;
} }
private static volatile com.google.protobuf.Parser<Model> PARSER; private static volatile com.google.protobuf.Parser<ReplyModel> PARSER;
public static com.google.protobuf.Parser<Model> parser() { public static com.google.protobuf.Parser<ReplyModel> parser() {
return DEFAULT_INSTANCE.getParserForType(); return DEFAULT_INSTANCE.getParserForType();
} }
} }

View File

@ -8,22 +8,25 @@ public final class SentBodyProto {
public static void registerAllExtensions( public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) { com.google.protobuf.ExtensionRegistryLite registry) {
} }
public interface ModelOrBuilder extends public interface SentModelOrBuilder extends
// @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.Model) // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.SentModel)
com.google.protobuf.MessageLiteOrBuilder { com.google.protobuf.MessageLiteOrBuilder {
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The key.
*/ */
String getKey(); String getKey();
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The bytes for key.
*/ */
com.google.protobuf.ByteString com.google.protobuf.ByteString
getKeyBytes(); getKeyBytes();
/** /**
* <code>optional int64 timestamp = 2;</code> * <code>int64 timestamp = 2;</code>
* @return The timestamp.
*/ */
long getTimestamp(); long getTimestamp();
@ -51,8 +54,10 @@ public final class SentBodyProto {
* <code>map&lt;string, string&gt; data = 3;</code> * <code>map&lt;string, string&gt; data = 3;</code>
*/ */
/* nullable */
String getDataOrDefault( String getDataOrDefault(
String key, String key,
/* nullable */
String defaultValue); String defaultValue);
/** /**
* <code>map&lt;string, string&gt; data = 3;</code> * <code>map&lt;string, string&gt; data = 3;</code>
@ -62,80 +67,83 @@ public final class SentBodyProto {
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< com.google.protobuf.GeneratedMessageLite<
Model, Model.Builder> implements SentModel, SentModel.Builder> implements
// @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.Model) // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.SentModel)
ModelOrBuilder { SentModelOrBuilder {
private Model() { private SentModel() {
key_ = ""; key_ = "";
} }
private int bitField0_;
public static final int KEY_FIELD_NUMBER = 1; public static final int KEY_FIELD_NUMBER = 1;
private String key_; private String key_;
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The key.
*/ */
@Override
public String getKey() { public String getKey() {
return key_; return key_;
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The bytes for key.
*/ */
@Override
public com.google.protobuf.ByteString public com.google.protobuf.ByteString
getKeyBytes() { getKeyBytes() {
return com.google.protobuf.ByteString.copyFromUtf8(key_); return com.google.protobuf.ByteString.copyFromUtf8(key_);
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @param value The key to set.
*/ */
private void setKey( private void setKey(
String value) { String value) {
if (value == null) { Class<?> valueClass = value.getClass();
throw new NullPointerException();
}
key_ = value; key_ = value;
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
*/ */
private void clearKey() { private void clearKey() {
key_ = getDefaultInstance().getKey(); key_ = getDefaultInstance().getKey();
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @param value The bytes for key to set.
*/ */
private void setKeyBytes( private void setKeyBytes(
com.google.protobuf.ByteString value) { com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value); checkByteStringIsUtf8(value);
key_ = value.toStringUtf8(); key_ = value.toStringUtf8();
} }
public static final int TIMESTAMP_FIELD_NUMBER = 2; public static final int TIMESTAMP_FIELD_NUMBER = 2;
private long timestamp_; private long timestamp_;
/** /**
* <code>optional int64 timestamp = 2;</code> * <code>int64 timestamp = 2;</code>
* @return The timestamp.
*/ */
@Override
public long getTimestamp() { public long getTimestamp() {
return timestamp_; return timestamp_;
} }
/** /**
* <code>optional int64 timestamp = 2;</code> * <code>int64 timestamp = 2;</code>
* @param value The timestamp to set.
*/ */
private void setTimestamp(long value) { private void setTimestamp(long value) {
timestamp_ = value; timestamp_ = value;
} }
/** /**
* <code>optional int64 timestamp = 2;</code> * <code>int64 timestamp = 2;</code>
*/ */
private void clearTimestamp() { private void clearTimestamp() {
@ -167,6 +175,7 @@ public final class SentBodyProto {
} }
return data_; return data_;
} }
@Override
public int getDataCount() { public int getDataCount() {
return internalGetData().size(); return internalGetData().size();
@ -174,15 +183,17 @@ public final class SentBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 3;</code> * <code>map&lt;string, string&gt; data = 3;</code>
*/ */
@Override
public boolean containsData( public boolean containsData(
String key) { String key) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
return internalGetData().containsKey(key); return internalGetData().containsKey(key);
} }
/** /**
* Use {@link #getDataMap()} instead. * Use {@link #getDataMap()} instead.
*/ */
@Override
@Deprecated @Deprecated
public java.util.Map<String, String> getData() { public java.util.Map<String, String> getData() {
return getDataMap(); return getDataMap();
@ -190,6 +201,7 @@ public final class SentBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 3;</code> * <code>map&lt;string, string&gt; data = 3;</code>
*/ */
@Override
public java.util.Map<String, String> getDataMap() { public java.util.Map<String, String> getDataMap() {
return java.util.Collections.unmodifiableMap( return java.util.Collections.unmodifiableMap(
@ -198,11 +210,12 @@ public final class SentBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 3;</code> * <code>map&lt;string, string&gt; data = 3;</code>
*/ */
@Override
public String getDataOrDefault( public String getDataOrDefault(
String key, String key,
String defaultValue) { String defaultValue) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
java.util.Map<String, String> map = java.util.Map<String, String> map =
internalGetData(); internalGetData();
return map.containsKey(key) ? map.get(key) : defaultValue; return map.containsKey(key) ? map.get(key) : defaultValue;
@ -210,10 +223,11 @@ public final class SentBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 3;</code> * <code>map&lt;string, string&gt; data = 3;</code>
*/ */
@Override
public String getDataOrThrow( public String getDataOrThrow(
String key) { String key) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
java.util.Map<String, String> map = java.util.Map<String, String> map =
internalGetData(); internalGetData();
if (!map.containsKey(key)) { if (!map.containsKey(key)) {
@ -229,97 +243,73 @@ public final class SentBodyProto {
return internalGetMutableData(); return internalGetMutableData();
} }
public void writeTo(com.google.protobuf.CodedOutputStream output) public static SentModel parseFrom(
throws java.io.IOException { java.nio.ByteBuffer data)
if (!key_.isEmpty()) { throws com.google.protobuf.InvalidProtocolBufferException {
output.writeString(1, getKey()); return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
} }
if (timestamp_ != 0L) { public static SentModel parseFrom(
output.writeInt64(2, timestamp_); java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
} }
for (java.util.Map.Entry<String, String> entry public static SentModel parseFrom(
: internalGetData().entrySet()) {
DataDefaultEntryHolder.defaultEntry.serializeTo(
output, 3, entry.getKey(), entry.getValue());
}
}
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<String, String> entry
: internalGetData().entrySet()) {
size += DataDefaultEntryHolder.defaultEntry.computeMessageSize(
3, entry.getKey(), entry.getValue());
}
memoizedSerializedSize = size;
return size;
}
public static Model parseFrom(
com.google.protobuf.ByteString data) com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data); DEFAULT_INSTANCE, data);
} }
public static Model parseFrom( public static SentModel parseFrom(
com.google.protobuf.ByteString data, com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry); DEFAULT_INSTANCE, data, extensionRegistry);
} }
public static Model parseFrom(byte[] data) public static SentModel parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data); DEFAULT_INSTANCE, data);
} }
public static Model parseFrom( public static SentModel parseFrom(
byte[] data, byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException { throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry); DEFAULT_INSTANCE, data, extensionRegistry);
} }
public static Model parseFrom(java.io.InputStream input) public static SentModel parseFrom(java.io.InputStream input)
throws java.io.IOException { throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input); DEFAULT_INSTANCE, input);
} }
public static Model parseFrom( public static SentModel parseFrom(
java.io.InputStream input, java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException { throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input, extensionRegistry); DEFAULT_INSTANCE, input, extensionRegistry);
} }
public static Model parseDelimitedFrom(java.io.InputStream input) public static SentModel parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException { throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input); return parseDelimitedFrom(DEFAULT_INSTANCE, input);
} }
public static Model parseDelimitedFrom( public static SentModel parseDelimitedFrom(
java.io.InputStream input, java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException { throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
} }
public static Model parseFrom( public static SentModel parseFrom(
com.google.protobuf.CodedInputStream input) com.google.protobuf.CodedInputStream input)
throws java.io.IOException { throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom( return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input); DEFAULT_INSTANCE, input);
} }
public static Model parseFrom( public static SentModel parseFrom(
com.google.protobuf.CodedInputStream input, com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException { throws java.io.IOException {
@ -328,41 +318,47 @@ public final class SentBodyProto {
} }
public static Builder newBuilder() { public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder(); return (Builder) DEFAULT_INSTANCE.createBuilder();
} }
public static Builder newBuilder(Model prototype) { public static Builder newBuilder(SentModel prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(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 public static final class Builder extends
com.google.protobuf.GeneratedMessageLite.Builder< com.google.protobuf.GeneratedMessageLite.Builder<
Model, Builder> implements SentModel, Builder> implements
// @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.Model) // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.SentModel)
ModelOrBuilder { SentModelOrBuilder {
// Construct using com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.newBuilder() // Construct using com.farsunset.cim.sdk.android.model.proto.SentBodyProto.SentModel.newBuilder()
private Builder() { private Builder() {
super(DEFAULT_INSTANCE); super(DEFAULT_INSTANCE);
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The key.
*/ */
@Override
public String getKey() { public String getKey() {
return instance.getKey(); return instance.getKey();
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return The bytes for key.
*/ */
@Override
public com.google.protobuf.ByteString public com.google.protobuf.ByteString
getKeyBytes() { getKeyBytes() {
return instance.getKeyBytes(); return instance.getKeyBytes();
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @param value The key to set.
* @return This builder for chaining.
*/ */
public Builder setKey( public Builder setKey(
String value) { String value) {
@ -371,7 +367,8 @@ public final class SentBodyProto {
return this; return this;
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @return This builder for chaining.
*/ */
public Builder clearKey() { public Builder clearKey() {
copyOnWrite(); copyOnWrite();
@ -379,7 +376,9 @@ public final class SentBodyProto {
return this; return this;
} }
/** /**
* <code>optional string key = 1;</code> * <code>string key = 1;</code>
* @param value The bytes for key to set.
* @return This builder for chaining.
*/ */
public Builder setKeyBytes( public Builder setKeyBytes(
com.google.protobuf.ByteString value) { com.google.protobuf.ByteString value) {
@ -389,13 +388,17 @@ public final class SentBodyProto {
} }
/** /**
* <code>optional int64 timestamp = 2;</code> * <code>int64 timestamp = 2;</code>
* @return The timestamp.
*/ */
@Override
public long getTimestamp() { public long getTimestamp() {
return instance.getTimestamp(); return instance.getTimestamp();
} }
/** /**
* <code>optional int64 timestamp = 2;</code> * <code>int64 timestamp = 2;</code>
* @param value The timestamp to set.
* @return This builder for chaining.
*/ */
public Builder setTimestamp(long value) { public Builder setTimestamp(long value) {
copyOnWrite(); copyOnWrite();
@ -403,7 +406,8 @@ public final class SentBodyProto {
return this; return this;
} }
/** /**
* <code>optional int64 timestamp = 2;</code> * <code>int64 timestamp = 2;</code>
* @return This builder for chaining.
*/ */
public Builder clearTimestamp() { public Builder clearTimestamp() {
copyOnWrite(); copyOnWrite();
@ -411,6 +415,7 @@ public final class SentBodyProto {
return this; return this;
} }
@Override
public int getDataCount() { public int getDataCount() {
return instance.getDataMap().size(); return instance.getDataMap().size();
@ -418,10 +423,11 @@ public final class SentBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 3;</code> * <code>map&lt;string, string&gt; data = 3;</code>
*/ */
@Override
public boolean containsData( public boolean containsData(
String key) { String key) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
return instance.getDataMap().containsKey(key); return instance.getDataMap().containsKey(key);
} }
@ -436,7 +442,7 @@ public final class SentBodyProto {
public Builder removeData( public Builder removeData(
String key) { String key) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
copyOnWrite(); copyOnWrite();
instance.getMutableDataMap().remove(key); instance.getMutableDataMap().remove(key);
return this; return this;
@ -444,6 +450,7 @@ public final class SentBodyProto {
/** /**
* Use {@link #getDataMap()} instead. * Use {@link #getDataMap()} instead.
*/ */
@Override
@Deprecated @Deprecated
public java.util.Map<String, String> getData() { public java.util.Map<String, String> getData() {
return getDataMap(); return getDataMap();
@ -451,6 +458,7 @@ public final class SentBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 3;</code> * <code>map&lt;string, string&gt; data = 3;</code>
*/ */
@Override
public java.util.Map<String, String> getDataMap() { public java.util.Map<String, String> getDataMap() {
return java.util.Collections.unmodifiableMap( return java.util.Collections.unmodifiableMap(
instance.getDataMap()); instance.getDataMap());
@ -458,11 +466,12 @@ public final class SentBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 3;</code> * <code>map&lt;string, string&gt; data = 3;</code>
*/ */
@Override
public String getDataOrDefault( public String getDataOrDefault(
String key, String key,
String defaultValue) { String defaultValue) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
java.util.Map<String, String> map = java.util.Map<String, String> map =
instance.getDataMap(); instance.getDataMap();
return map.containsKey(key) ? map.get(key) : defaultValue; return map.containsKey(key) ? map.get(key) : defaultValue;
@ -470,10 +479,11 @@ public final class SentBodyProto {
/** /**
* <code>map&lt;string, string&gt; data = 3;</code> * <code>map&lt;string, string&gt; data = 3;</code>
*/ */
@Override
public String getDataOrThrow( public String getDataOrThrow(
String key) { String key) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
java.util.Map<String, String> map = java.util.Map<String, String> map =
instance.getDataMap(); instance.getDataMap();
if (!map.containsKey(key)) { if (!map.containsKey(key)) {
@ -487,8 +497,8 @@ public final class SentBodyProto {
public Builder putData( public Builder putData(
String key, String key,
String value) { String value) {
if (key == null) { throw new NullPointerException(); } Class<?> keyClass = key.getClass();
if (value == null) { throw new NullPointerException(); } Class<?> valueClass = value.getClass();
copyOnWrite(); copyOnWrite();
instance.getMutableDataMap().put(key, value); instance.getMutableDataMap().put(key, value);
return this; return this;
@ -503,118 +513,80 @@ public final class SentBodyProto {
return this; 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( protected final Object dynamicMethod(
MethodToInvoke method, MethodToInvoke method,
Object arg0, Object arg1) { Object arg0, Object arg1) {
switch (method) { switch (method) {
case NEW_MUTABLE_INSTANCE: { case NEW_MUTABLE_INSTANCE: {
return new Model(); return new SentModel();
}
case IS_INITIALIZED: {
return DEFAULT_INSTANCE;
}
case MAKE_IMMUTABLE: {
data_.makeImmutable();
return null;
} }
case NEW_BUILDER: { case NEW_BUILDER: {
return new Builder(); return new Builder();
} }
case VISIT: { case BUILD_MESSAGE_INFO: {
Visitor visitor = (Visitor) arg0; Object[] objects = new Object[] {
Model other = (Model) arg1; "key_",
key_ = visitor.visitString(!key_.isEmpty(), key_, "timestamp_",
!other.key_.isEmpty(), other.key_); "data_",
timestamp_ = visitor.visitLong(timestamp_ != 0L, timestamp_, DataDefaultEntryHolder.defaultEntry,
other.timestamp_ != 0L, other.timestamp_); };
data_ = visitor.visitMap( String info =
data_, other.internalGetData()); "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0001\u0000\u0000\u0001\u0208\u0002\u0002" +
if (visitor == MergeFromVisitor "\u00032";
.INSTANCE) { return newMessageInfo(DEFAULT_INSTANCE, info, objects);
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 {
}
} }
// fall through
case GET_DEFAULT_INSTANCE: { case GET_DEFAULT_INSTANCE: {
return DEFAULT_INSTANCE; return DEFAULT_INSTANCE;
} }
case GET_PARSER: { case GET_PARSER: {
if (PARSER == null) { synchronized (Model.class) { com.google.protobuf.Parser<SentModel> parser = PARSER;
if (PARSER == null) { if (parser == null) {
PARSER = new DefaultInstanceBasedParser(DEFAULT_INSTANCE); synchronized (SentModel.class) {
parser = PARSER;
if (parser == null) {
parser =
new DefaultInstanceBasedParser<SentModel>(
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(); throw new UnsupportedOperationException();
} }
// @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.Model) // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.SentModel)
private static final Model DEFAULT_INSTANCE; private static final SentModel DEFAULT_INSTANCE;
static { static {
DEFAULT_INSTANCE = new Model(); SentModel defaultInstance = new SentModel();
DEFAULT_INSTANCE.makeImmutable(); // 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; return DEFAULT_INSTANCE;
} }
private static volatile com.google.protobuf.Parser<Model> PARSER; private static volatile com.google.protobuf.Parser<SentModel> PARSER;
public static com.google.protobuf.Parser<Model> parser() { public static com.google.protobuf.Parser<SentModel> parser() {
return DEFAULT_INSTANCE.getParserForType(); return DEFAULT_INSTANCE.getParserForType();
} }
} }

View File

@ -1,7 +1,7 @@
syntax = "proto3"; syntax = "proto3";
package com.farsunset.cim.sdk.android.model.proto; package com.farsunset.cim.sdk.android.model.proto;
option java_outer_classname = "MessageProto"; option java_outer_classname = "MessageProto";
message Model { message MessageModel {
int64 id = 1; int64 id = 1;
string action = 2; string action = 2;
string content = 3; string content = 3;

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package com.farsunset.cim.sdk.android.model.proto; package com.farsunset.cim.sdk.android.model.proto;
option java_outer_classname = "ReplyBodyProto"; option java_outer_classname = "ReplyBodyProto";
message Model { message ReplyModel {
string key = 1; string key = 1;
string code = 2; string code = 2;
string message = 3; string message = 3;

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package com.farsunset.cim.sdk.android.model.proto; package com.farsunset.cim.sdk.android.model.proto;
option java_outer_classname = "SentBodyProto"; option java_outer_classname = "SentBodyProto";
message Model { message SentModel {
string key = 1; string key = 1;
int64 timestamp = 2; int64 timestamp = 2;
map<string, string> data = 3; map<string, string> data = 3;