diff --git a/README.md b/README.md index 3c51975..a83e41d 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ CIM是基于mina和netty框架下的推送系统,我们平常使用第三方 2.android sdk升级,适配android8.0+,修复一些之前的兼容性问题 +2.消息的id字段名由mid修改为id,类型由String修改为long; + diff --git a/cim_for_mina/cim-android-sdk/libs/cim-android-sdk-3.5.jar b/cim_for_mina/cim-android-sdk/libs/cim-android-sdk-3.5.jar deleted file mode 100644 index 1d1166c..0000000 Binary files a/cim_for_mina/cim-android-sdk/libs/cim-android-sdk-3.5.jar and /dev/null differ diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java index a25fb97..33b36f8 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java @@ -58,7 +58,9 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver { /* * 设备网络状态变化事件 */ - if (intent.getAction().equals(CIMConstant.IntentAction.ACTION_NETWORK_CHANGED)) { + if (intent.getAction().equals(CIMConstant.IntentAction.ACTION_NETWORK_CHANGED) + ||intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) { + ConnectivityManager connectivityManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); onDevicesNetworkChanged(connectivityManager.getActiveNetworkInfo()); diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java index 3e78dd1..aea881b 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java @@ -27,6 +27,8 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.net.ConnectivityManager; +import android.net.Network; import android.os.Build; import android.os.Handler; import android.os.IBinder; @@ -34,6 +36,7 @@ import android.os.Message; import java.util.concurrent.Semaphore; +import com.farsunset.cim.sdk.android.constant.CIMConstant; import com.farsunset.cim.sdk.android.filter.CIMLoggingFilter; import com.farsunset.cim.sdk.android.model.SentBody; @@ -49,16 +52,40 @@ public class CIMPushService extends Service { private CIMConnectorManager manager; private KeepAliveBroadcastReceiver keepAliveReceiver; - private Semaphore semaphore = new Semaphore(1,true); + private Semaphore semaphore = new Semaphore(1, true); @Override public void onCreate() { manager = CIMConnectorManager.getManager(this.getApplicationContext()); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + keepAliveReceiver = new KeepAliveBroadcastReceiver(); registerReceiver(keepAliveReceiver, keepAliveReceiver.getIntentFilter()); } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + + ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); + connectivityManager.registerDefaultNetworkCallback(new ConnectivityManager.NetworkCallback() { + @Override + public void onAvailable(Network network) { + Intent intent = new Intent(); + intent.setPackage(getPackageName()); + intent.setAction(CIMConstant.IntentAction.ACTION_NETWORK_CHANGED); + sendBroadcast(intent); + } + @Override + public void onUnavailable() { + Intent intent = new Intent(); + intent.setPackage(getPackageName()); + intent.setAction(CIMConstant.IntentAction.ACTION_NETWORK_CHANGED); + sendBroadcast(intent); + } + + }); + + } } Handler connectionHandler = new Handler() { @@ -75,9 +102,9 @@ public class CIMPushService extends Service { public int onStartCommand(Intent intent, int flags, int startId) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - startForeground(this.hashCode(), new Notification.Builder(this,null).build()); + startForeground(this.hashCode(), new Notification.Builder(this, null).build()); } - + intent = (intent == null ? new Intent(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE) : intent); String action = intent.getAction(); @@ -107,59 +134,56 @@ public class CIMPushService extends Service { boolean enable = intent.getBooleanExtra(KEY_LOGGER_ENABLE, true); CIMLoggingFilter.getLogger().debugMode(enable); } - + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { stopForeground(true); } - + return super.onStartCommand(intent, flags, startId); } private void handleConnection(Intent intent) { - - long delayMillis = intent.getLongExtra(KEY_DELAYED_TIME, 0); - + if (delayMillis <= 0) { String host = intent.getStringExtra(CIMCacheManager.KEY_CIM_SERVIER_HOST); int port = intent.getIntExtra(CIMCacheManager.KEY_CIM_SERVIER_PORT, 0); manager.connect(host, port); - return; - } - - if(!semaphore.tryAcquire()) { return; } - - + + if (!semaphore.tryAcquire()) { + return; + } + Message msg = connectionHandler.obtainMessage(); msg.what = 0; msg.setData(intent.getExtras()); connectionHandler.sendMessageDelayed(msg, delayMillis); - + } - + private void handleKeepAlive() { if (manager.isConnected()) { CIMLoggingFilter.getLogger().connectState(true); return; - } + } - boolean isManualStop = CIMCacheManager.getBoolean(getApplicationContext(),CIMCacheManager.KEY_MANUAL_STOP); - boolean isDestroyed = CIMCacheManager.getBoolean(getApplicationContext(),CIMCacheManager.KEY_CIM_DESTROYED); + boolean isManualStop = CIMCacheManager.getBoolean(getApplicationContext(), CIMCacheManager.KEY_MANUAL_STOP); + boolean isDestroyed = CIMCacheManager.getBoolean(getApplicationContext(), CIMCacheManager.KEY_CIM_DESTROYED); CIMLoggingFilter.getLogger().connectState(false, isManualStop, isDestroyed); - + CIMPushManager.connect(this, 0); } - + @Override public IBinder onBind(Intent arg0) { return null; } - + @Override public void onDestroy() { super.onDestroy(); @@ -167,24 +191,23 @@ public class CIMPushService extends Service { unregisterReceiver(keepAliveReceiver); } } - - public class KeepAliveBroadcastReceiver extends BroadcastReceiver{ + + public class KeepAliveBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context arg0, Intent arg1) { handleKeepAlive(); } - + public IntentFilter getIntentFilter() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_POWER_CONNECTED); intentFilter.addAction(Intent.ACTION_POWER_DISCONNECTED); intentFilter.addAction(Intent.ACTION_SCREEN_ON); intentFilter.addAction(Intent.ACTION_USER_PRESENT); - return intentFilter; } - + } } diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java index a503fde..a631dcd 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java @@ -94,9 +94,9 @@ public interface CIMConstant { // 发送sendbody成功后获得replaybody回应广播 String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; - + // 网络变化广播 - String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; + String ACTION_NETWORK_CHANGED = "com.farsunset.cim.NETWORK_CHANAGED"; // 重试连接 String ACTION_CONNECTION_RECOVERY = "com.farsunset.cim.CONNECTION_RECOVERY"; diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java index 7c2b137..9ddc1ec 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java @@ -97,7 +97,7 @@ public class ClientMessageDecoder extends CumulativeProtocolDecoder { if (CIMConstant.ProtobufType.MESSAGE == type) { MessageProto.Model bodyProto = MessageProto.Model.parseFrom(bytes); Message message = new Message(); - message.setMid(bodyProto.getMid()); + message.setId(bodyProto.getId()); message.setAction(bodyProto.getAction()); message.setContent(bodyProto.getContent()); message.setSender(bodyProto.getSender()); diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java index d0185c5..fcbca5f 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java @@ -33,7 +33,7 @@ public class Message implements Serializable { /** * 消息类型,用户自定义消息类别 */ - private String mid; + private long id; /** * 消息类型,用户自定义消息类别 @@ -141,7 +141,7 @@ public class Message implements Serializable { StringBuffer buffer = new StringBuffer(); buffer.append("#Message#").append("\n"); - buffer.append("mid:").append(mid).append("\n"); + buffer.append("id:").append(id).append("\n"); buffer.append("action:").append(action).append("\n"); buffer.append("title:").append(title).append("\n"); buffer.append("content:").append(content).append("\n"); @@ -152,13 +152,14 @@ public class Message implements Serializable { buffer.append("timestamp:").append(timestamp); return buffer.toString(); } - - public String getMid() { - return mid; + + + public long getId() { + return id; } - public void setMid(String mid) { - this.mid = mid; + public void setId(long id) { + this.id = id; } public boolean isNotEmpty(String txt) { diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto index a5cb5ee..aee4268 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package com.farsunset.cim.sdk.android.model.proto; option java_outer_classname="MessageProto"; message Model { - string mid = 1; + int64 id = 1; string action = 2; string content = 3; string sender = 4; diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java index 74c02e5..9f00868 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java @@ -19,14 +19,9 @@ public final class MessageProto { com.google.protobuf.MessageOrBuilder { /** - * string mid = 1; + * int64 id = 1; */ - java.lang.String getMid(); - /** - * string mid = 1; - */ - com.google.protobuf.ByteString - getMidBytes(); + long getId(); /** * string action = 2; @@ -116,7 +111,6 @@ public final class MessageProto { super(builder); } private Model() { - mid_ = ""; action_ = ""; content_ = ""; sender_ = ""; @@ -150,10 +144,9 @@ public final class MessageProto { case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - mid_ = s; + id_ = input.readInt64(); break; } case 18: { @@ -235,38 +228,13 @@ public final class MessageProto { com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.Builder.class); } - public static final int MID_FIELD_NUMBER = 1; - private volatile java.lang.Object mid_; + public static final int ID_FIELD_NUMBER = 1; + private long id_; /** - * string mid = 1; + * int64 id = 1; */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } - } - /** - * string mid = 1; - */ - public com.google.protobuf.ByteString - getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public long getId() { + return id_; } public static final int ACTION_FIELD_NUMBER = 2; @@ -530,8 +498,8 @@ public final class MessageProto { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getMidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); + if (id_ != 0L) { + output.writeInt64(1, id_); } if (!getActionBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); @@ -566,8 +534,9 @@ public final class MessageProto { if (size != -1) return size; size = 0; - if (!getMidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); } if (!getActionBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); @@ -609,8 +578,8 @@ public final class MessageProto { } com.farsunset.cim.sdk.android.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.android.model.proto.MessageProto.Model) obj; - if (!getMid() - .equals(other.getMid())) return false; + if (getId() + != other.getId()) return false; if (!getAction() .equals(other.getAction())) return false; if (!getContent() @@ -638,8 +607,9 @@ public final class MessageProto { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + MID_FIELD_NUMBER; - hash = (53 * hash) + getMid().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); hash = (37 * hash) + ACTION_FIELD_NUMBER; hash = (53 * hash) + getAction().hashCode(); hash = (37 * hash) + CONTENT_FIELD_NUMBER; @@ -790,7 +760,7 @@ public final class MessageProto { @java.lang.Override public Builder clear() { super.clear(); - mid_ = ""; + id_ = 0L; action_ = ""; @@ -834,7 +804,7 @@ public final class MessageProto { @java.lang.Override public com.farsunset.cim.sdk.android.model.proto.MessageProto.Model buildPartial() { com.farsunset.cim.sdk.android.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.android.model.proto.MessageProto.Model(this); - result.mid_ = mid_; + result.id_ = id_; result.action_ = action_; result.content_ = content_; result.sender_ = sender_; @@ -891,9 +861,8 @@ public final class MessageProto { public Builder mergeFrom(com.farsunset.cim.sdk.android.model.proto.MessageProto.Model other) { if (other == com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.getDefaultInstance()) return this; - if (!other.getMid().isEmpty()) { - mid_ = other.mid_; - onChanged(); + if (other.getId() != 0L) { + setId(other.getId()); } if (!other.getAction().isEmpty()) { action_ = other.action_; @@ -955,71 +924,28 @@ public final class MessageProto { return this; } - private java.lang.Object mid_ = ""; + private long id_ ; /** - * string mid = 1; + * int64 id = 1; */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } else { - return (java.lang.String) ref; - } + public long getId() { + return id_; } /** - * string mid = 1; + * int64 id = 1; */ - public com.google.protobuf.ByteString - getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string mid = 1; - */ - public Builder setMid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - mid_ = value; + public Builder setId(long value) { + + id_ = value; onChanged(); return this; } /** - * string mid = 1; + * int64 id = 1; */ - public Builder clearMid() { + public Builder clearId() { - mid_ = getDefaultInstance().getMid(); - onChanged(); - return this; - } - /** - * string mid = 1; - */ - public Builder setMidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - mid_ = value; + id_ = 0L; onChanged(); return this; } @@ -1600,11 +1526,11 @@ public final class MessageProto { static { java.lang.String[] descriptorData = { "\n\rMessage.proto\022)com.farsunset.cim.sdk.a" + - "ndroid.model.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(" + - "\t\022\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006se" + - "nder\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 " + - "\001(\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\tti" + - "mestamp\030\t \001(\003B\016B\014MessageProtob\006proto3" + "ndroid.model.proto\"\227\001\n\005Model\022\n\n\002id\030\001 \001(\003" + + "\022\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sen" + + "der\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001" + + "(\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttim" + + "estamp\030\t \001(\003B\016B\014MessageProtob\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -1623,7 +1549,7 @@ public final class MessageProto { internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor, - new java.lang.String[] { "Mid", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + new java.lang.String[] { "Id", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/cim_for_mina/cim-boot-server/libs/cim-server-sdk-3.5.jar b/cim_for_mina/cim-boot-server/libs/cim-server-sdk-3.6.jar similarity index 62% rename from cim_for_mina/cim-boot-server/libs/cim-server-sdk-3.5.jar rename to cim_for_mina/cim-boot-server/libs/cim-server-sdk-3.6.jar index ac9ec95..eaa557e 100644 Binary files a/cim_for_mina/cim-boot-server/libs/cim-server-sdk-3.5.jar and b/cim_for_mina/cim-boot-server/libs/cim-server-sdk-3.6.jar differ diff --git a/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/MessageController.java b/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/MessageController.java index d2e5444..c42ed85 100644 --- a/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/MessageController.java +++ b/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/MessageController.java @@ -32,7 +32,6 @@ import com.farsunset.cim.push.DefaultMessagePusher; import com.farsunset.cim.push.SystemMessagePusher; import com.farsunset.cim.sdk.server.model.Message; import com.farsunset.cim.util.Constants; -import com.farsunset.cim.util.StringUtil; @RestController @@ -65,13 +64,13 @@ public class MessageController { MessageResult result = new MessageResult(); - message.setMid(StringUtil.getUUID()); + message.setId(System.currentTimeMillis()); if (Constants.MessageType.TYPE_2.equals(message.getAction())) { systemMessagePusher.push(message); } else { defaultMessagePusher.push(message); } - result.id = message.getMid(); + result.id = message.getId(); result.timestamp = message.getTimestamp(); return result; } diff --git a/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/dto/MessageResult.java b/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/dto/MessageResult.java index 3ce24d7..3e84d51 100644 --- a/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/dto/MessageResult.java +++ b/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/dto/MessageResult.java @@ -23,5 +23,5 @@ package com.farsunset.cim.api.controller.dto; public class MessageResult extends BaseResult { public long timestamp; - public String id; + public long id; } diff --git a/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/handler/BindHandler.java b/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/handler/BindHandler.java index d3506e3..73aedb1 100644 --- a/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/handler/BindHandler.java +++ b/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/handler/BindHandler.java @@ -123,7 +123,7 @@ public class BindHandler implements CIMRequestHandler { msg.setReceiver(account); msg.setSender("system"); msg.setContent(deviceModel); - msg.setMid(StringUtil.getUUID()); + msg.setId(System.currentTimeMillis()); closeQuietly(oldSession,msg); } diff --git a/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/service/impl/MessageDispatcherImpl.java b/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/service/impl/MessageDispatcherImpl.java index 6da069f..3f7ab3c 100644 --- a/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/service/impl/MessageDispatcherImpl.java +++ b/cim_for_mina/cim-boot-server/src/main/java/com/farsunset/cim/service/impl/MessageDispatcherImpl.java @@ -62,7 +62,7 @@ public class MessageDispatcherImpl implements MessageDispatcher{ OkHttpClient httpclient = new OkHttpClient.Builder().connectTimeout(10, TimeUnit.SECONDS).build(); FormBody.Builder build = new FormBody.Builder(); - build.add("mid", String.valueOf(msg.getMid())); + build.add("id", String.valueOf(msg.getId())); build.add("action", msg.getAction()); build.add("title", msg.getTitle()); build.add("content", msg.getContent()); diff --git a/cim_for_mina/cim-boot-server/src/main/resources/static/js/cim/message.js b/cim_for_mina/cim-boot-server/src/main/resources/static/js/cim/message.js index 644e760..30b942a 100644 --- a/cim_for_mina/cim-boot-server/src/main/resources/static/js/cim/message.js +++ b/cim_for_mina/cim-boot-server/src/main/resources/static/js/cim/message.js @@ -13,7 +13,6 @@ var goog = jspb; var global = Function('return this')(); goog.exportSymbol('proto.com.farsunset.cim.sdk.web.model.Message', null, global); - /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -29,10 +28,15 @@ proto.com.farsunset.cim.sdk.web.model.Message = function(opt_data) { }; goog.inherits(proto.com.farsunset.cim.sdk.web.model.Message, jspb.Message); if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ proto.com.farsunset.cim.sdk.web.model.Message.displayName = 'proto.com.farsunset.cim.sdk.web.model.Message'; } + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. @@ -59,8 +63,8 @@ proto.com.farsunset.cim.sdk.web.model.Message.prototype.toObject = function(opt_ * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.com.farsunset.cim.sdk.web.model.Message.toObject = function(includeInstance, msg) { - var f, obj = { - mid: jspb.Message.getFieldWithDefault(msg, 1, ""), + var obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, 0), action: jspb.Message.getFieldWithDefault(msg, 2, ""), content: jspb.Message.getFieldWithDefault(msg, 3, ""), sender: jspb.Message.getFieldWithDefault(msg, 4, ""), @@ -106,8 +110,8 @@ proto.com.farsunset.cim.sdk.web.model.Message.deserializeBinaryFromReader = func var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setMid(value); + var value = /** @type {number} */ (reader.readInt64()); + msg.setId(value); break; case 2: var value = /** @type {string} */ (reader.readString()); @@ -170,9 +174,9 @@ proto.com.farsunset.cim.sdk.web.model.Message.prototype.serializeBinary = functi */ proto.com.farsunset.cim.sdk.web.model.Message.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getMid(); - if (f.length > 0) { - writer.writeString( + f = message.getId(); + if (f !== 0) { + writer.writeInt64( 1, f ); @@ -237,17 +241,17 @@ proto.com.farsunset.cim.sdk.web.model.Message.serializeBinaryToWriter = function /** - * optional string mid = 1; - * @return {string} + * optional int64 id = 1; + * @return {number} */ -proto.com.farsunset.cim.sdk.web.model.Message.prototype.getMid = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.com.farsunset.cim.sdk.web.model.Message.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; -/** @param {string} value */ -proto.com.farsunset.cim.sdk.web.model.Message.prototype.setMid = function(value) { - jspb.Message.setProto3StringField(this, 1, value); +/** @param {number} value */ +proto.com.farsunset.cim.sdk.web.model.Message.prototype.setId = function(value) { + jspb.Message.setProto3IntField(this, 1, value); }; @@ -374,12 +378,12 @@ proto.com.farsunset.cim.sdk.web.model.Message.prototype.setTimestamp = function( goog.object.extend(exports, proto.com.farsunset.cim.sdk.web.model); },{"google-protobuf":3}],2:[function(require,module,exports){ -var messageProtobuf= require('./MessageProtobuf'); +var myProto = require('./Message_pb'); module.exports = { - DataProto: messageProtobuf + DataProto: myProto } -},{"./MessageProtobuf":1}],3:[function(require,module,exports){ +},{"./Message_pb":1}],3:[function(require,module,exports){ (function (global,Buffer){ var $jscomp={scope:{},getGlobal:function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global?global:a}};$jscomp.global=$jscomp.getGlobal(this);$jscomp.initSymbol=function(){$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol);$jscomp.initSymbol=function(){}};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(a){return"jscomp_symbol_"+a+$jscomp.symbolCounter_++}; $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();$jscomp.global.Symbol.iterator||($jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));$jscomp.initSymbolIterator=function(){}};$jscomp.makeIterator=function(a){$jscomp.initSymbolIterator();$jscomp.initSymbol();$jscomp.initSymbolIterator();var b=a[Symbol.iterator];if(b)return b.call(a);var c=0;return{next:function(){return c=a||"\u0080"<=a&&"\ufffd">=a};goog.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};goog.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")}; @@ -485,16 +492,7 @@ goog.asserts.assertString=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isS goog.asserts.assertObject=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isObject(a)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertArray=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isArray(a)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a}; goog.asserts.assertBoolean=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(a)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertElement=function(a,b,c){!goog.asserts.ENABLE_ASSERTS||goog.isObject(a)&&a.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a}; goog.asserts.assertInstanceof=function(a,b,c,d){!goog.asserts.ENABLE_ASSERTS||a instanceof b||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(b),goog.asserts.getType_(a)],c,Array.prototype.slice.call(arguments,3));return a};goog.asserts.assertObjectPrototypeIsIntact=function(){for(var a in Object.prototype)goog.asserts.fail(a+" should not be enumerable in Object.prototype.")}; -goog.asserts.getType_=function(a){return a instanceof Function?a.displayName||a.name||"unknown type name":a instanceof Object?a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a):null===a?"null":typeof a};var jspb={Map:function(a,b){this.arr_=a;this.valueCtor_=b;this.map_={};this.arrClean=!0;0c?Math.max(0,a.length+c):c;if(goog.isString(a))return goog.isString(b)&&1==b.length?a.indexOf(b,c):-1;for(;cc&&(c=Math.max(0,a.length+c));if(goog.isString(a))return goog.isString(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in a&&a[c]===b)return c;return-1}; goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(a,b,c){goog.asserts.assert(null!=a.length);Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f>4);64!=g&&(b(f<<4&240|g>>2),64!=h&&b(g<<6&192|h))}}; goog.crypt.base64.init_=function(){if(!goog.crypt.base64.byteToCharMap_){goog.crypt.base64.byteToCharMap_={};goog.crypt.base64.charToByteMap_={};goog.crypt.base64.byteToCharMapWebSafe_={};for(var a=0;a=goog.crypt.base64.ENCODED_VALS_BASE.length&& -(goog.crypt.base64.charToByteMap_[goog.crypt.base64.ENCODED_VALS_WEBSAFE.charAt(a)]=a)}};jspb.ExtensionFieldInfo=function(a,b,c,d,e){this.fieldIndex=a;this.fieldName=b;this.ctor=c;this.toObjectFn=d;this.isRepeated=e};jspb.ExtensionFieldBinaryInfo=function(a,b,c,d,e,f){this.fieldInfo=a;this.binaryReaderFn=b;this.binaryWriterFn=c;this.binaryMessageSerializeFn=d;this.binaryMessageDeserializeFn=e;this.isPacked=f};jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor};jspb.Message=function(){};jspb.Message.GENERATE_TO_OBJECT=!0;jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE; +(goog.crypt.base64.charToByteMap_[goog.crypt.base64.ENCODED_VALS_WEBSAFE.charAt(a)]=a)}};jspb.utils={};jspb.utils.split64Low=0;jspb.utils.split64High=0;jspb.utils.splitUint64=function(a){var b=a>>>0;a=Math.floor((a-b)/jspb.BinaryConstants.TWO_TO_32)>>>0;jspb.utils.split64Low=b;jspb.utils.split64High=a};jspb.utils.splitInt64=function(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/jspb.BinaryConstants.TWO_TO_32);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295a;a=2*Math.abs(a);jspb.utils.splitUint64(a);a=jspb.utils.split64Low;var c=jspb.utils.split64High;b&&(0==a?0==c?c=a=4294967295:(c--,a=4294967295):a--);jspb.utils.split64Low=a;jspb.utils.split64High=c}; +jspb.utils.splitFloat32=function(a){var b=0>a?1:0;a=b?-a:a;var c;0===a?0<1/a?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648):isNaN(a)?(jspb.utils.split64High=0,jspb.utils.split64Low=2147483647):a>jspb.BinaryConstants.FLOAT32_MAX?(jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|2139095040)>>>0):a>>0):(c=Math.floor(Math.log(a)/ +Math.LN2),a*=Math.pow(2,-c),a=Math.round(a*jspb.BinaryConstants.TWO_TO_23)&8388607,jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|c+127<<23|a)>>>0)}; +jspb.utils.splitFloat64=function(a){var b=0>a?1:0;a=b?-a:a;if(0===a)jspb.utils.split64High=0<1/a?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(a))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(a>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(b<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(a>>0;jspb.utils.split64Low=c>>>0}else{var d= +Math.floor(Math.log(a)/Math.LN2);1024==d&&(d=1023);c=a*Math.pow(2,-d);a=c*jspb.BinaryConstants.TWO_TO_20&1048575;c=c*jspb.BinaryConstants.TWO_TO_52>>>0;jspb.utils.split64High=(b<<31|d+1023<<20|a)>>>0;jspb.utils.split64Low=c}}; +jspb.utils.splitHash64=function(a){var b=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=a.charCodeAt(4),g=a.charCodeAt(5),h=a.charCodeAt(6);a=a.charCodeAt(7);jspb.utils.split64Low=b+(c<<8)+(d<<16)+(e<<24)>>>0;jspb.utils.split64High=f+(g<<8)+(h<<16)+(a<<24)>>>0};jspb.utils.joinUint64=function(a,b){return b*jspb.BinaryConstants.TWO_TO_32+a}; +jspb.utils.joinInt64=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinZigzag64=function(a,b){var c=a&1;a=(a>>>1|b<<31)>>>0;b>>>=1;c&&(a=a+1>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinFloat32=function(a,b){var c=2*(a>>31)+1,d=a>>>23&255,e=a&8388607;return 255==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-149)*e:c*Math.pow(2,d-150)*(e+Math.pow(2,23))}; +jspb.utils.joinFloat64=function(a,b){var c=2*(b>>31)+1,d=b>>>20&2047,e=jspb.BinaryConstants.TWO_TO_32*(b&1048575)+a;return 2047==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-1074)*e:c*Math.pow(2,d-1075)*(e+jspb.BinaryConstants.TWO_TO_52)};jspb.utils.joinHash64=function(a,b){return String.fromCharCode(a>>>0&255,a>>>8&255,a>>>16&255,a>>>24&255,b>>>0&255,b>>>8&255,b>>>16&255,b>>>24&255)};jspb.utils.DIGITS="0123456789abcdef".split(""); +jspb.utils.joinUnsignedDecimalString=function(a,b){function c(a){for(var b=1E7,c=0;7>c;c++){var b=b/10,d=a/b%10>>>0;if(0!=d||h)h=!0,k+=g[d]}}if(2097151>=b)return""+(jspb.BinaryConstants.TWO_TO_32*b+a);var d=(a>>>24|b<<8)>>>0&16777215,e=b>>16&65535,f=(a&16777215)+6777216*d+6710656*e,d=d+8147497*e,e=2*e;1E7<=f&&(d+=Math.floor(f/1E7),f%=1E7);1E7<=d&&(e+=Math.floor(d/1E7),d%=1E7);var g=jspb.utils.DIGITS,h=!1,k="";(e||h)&&c(e);(d||h)&&c(d);(f||h)&&c(f);return k}; +jspb.utils.joinSignedDecimalString=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b+(0==a?1:0)>>>0);var d=jspb.utils.joinUnsignedDecimalString(a,b);return c?"-"+d:d};jspb.utils.hash64ToDecimalString=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinSignedDecimalString(c,d):jspb.utils.joinUnsignedDecimalString(c,d)}; +jspb.utils.hash64ArrayToDecimalStrings=function(a,b){for(var c=Array(a.length),d=0;dc&&(1!==a||0>>8}}function c(){for(var a=0;8>a;a++)e[a]=~e[a]&255}goog.asserts.assert(0c;c++){var d=a.charCodeAt(7-c);b[2*c+2]=jspb.utils.DIGITS[d>>4];b[2*c+3]=jspb.utils.DIGITS[d&15]}return b.join("")};jspb.utils.hexStringToHash64=function(a){a=a.toLowerCase();goog.asserts.assert(18==a.length);goog.asserts.assert("0"==a[0]);goog.asserts.assert("x"==a[1]);for(var b="",c=0;8>c;c++)var d=jspb.utils.DIGITS.indexOf(a[2*c+2]),e=jspb.utils.DIGITS.indexOf(a[2*c+3]),b=String.fromCharCode(16*d+e)+b;return b}; +jspb.utils.hash64ToNumber=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinInt64(c,d):jspb.utils.joinUint64(c,d)};jspb.utils.numberToHash64=function(a){jspb.utils.splitInt64(a);return jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.utils.countVarints=function(a,b,c){for(var d=0,e=b;e>7;return c-b-d}; +jspb.utils.countVarintFields=function(a,b,c,d){var e=0;d=8*d+jspb.BinaryConstants.WireType.VARINT;if(128>d)for(;b>=7}if(a[b++]!=f)break;for(e++;f=a[b++],0!=(f&128););}return e};jspb.utils.countFixedFields_=function(a,b,c,d,e){var f=0;if(128>d)for(;b>=7}if(a[b++]!=g)break;f++;b+=e}return f}; +jspb.utils.countFixed32Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED32,4)};jspb.utils.countFixed64Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED64,8)}; +jspb.utils.countDelimitedFields=function(a,b,c,d){var e=0;for(d=8*d+jspb.BinaryConstants.WireType.DELIMITED;b>=7}if(a[b++]!=f)break;e++;for(var g=0,h=1;f=a[b++],g+=(f&127)*h,h*=128,0!=(f&128););b+=g}return e};jspb.utils.debugBytesToTextFormat=function(a){var b='"';if(a){a=jspb.utils.byteSourceToUint8Array(a);for(var c=0;ca[c]&&(b+="0"),b+=a[c].toString(16)}return b+'"'}; +jspb.utils.debugScalarToTextFormat=function(a){return goog.isString(a)?goog.string.quote(a):a.toString()};jspb.utils.stringToByteArray=function(a){for(var b=new Uint8Array(a.length),c=0;cjspb.BinaryIterator.instanceCache_.length&&jspb.BinaryIterator.instanceCache_.push(this)}; +jspb.BinaryIterator.prototype.clear=function(){this.decoder_&&this.decoder_.free();this.elements_=this.nextMethod_=this.decoder_=null;this.cursor_=0;this.nextValue_=null;this.atEnd_=!0};jspb.BinaryIterator.prototype.get=function(){return this.nextValue_};jspb.BinaryIterator.prototype.atEnd=function(){return this.atEnd_}; +jspb.BinaryIterator.prototype.next=function(){var a=this.nextValue_;this.decoder_?this.decoder_.atEnd()?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.nextMethod_.call(this.decoder_):this.elements_&&(this.cursor_==this.elements_.length?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.elements_[this.cursor_++]);return a};jspb.BinaryDecoder=function(a,b,c){this.bytes_=null;this.tempHigh_=this.tempLow_=this.cursor_=this.end_=this.start_=0;this.error_=!1;a&&this.setBlock(a,b,c)}; +jspb.BinaryDecoder.instanceCache_=[];jspb.BinaryDecoder.alloc=function(a,b,c){if(jspb.BinaryDecoder.instanceCache_.length){var d=jspb.BinaryDecoder.instanceCache_.pop();a&&d.setBlock(a,b,c);return d}return new jspb.BinaryDecoder(a,b,c)};jspb.BinaryDecoder.prototype.free=function(){this.clear();100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)};jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)}; +jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null;this.cursor_=this.end_=this.start_=0;this.error_=!1};jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_};jspb.BinaryDecoder.prototype.setBlock=function(a,b,c){this.bytes_=jspb.utils.byteSourceToUint8Array(a);this.start_=goog.isDef(b)?b:0;this.end_=goog.isDef(c)?this.start_+c:this.bytes_.length;this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_}; +jspb.BinaryDecoder.prototype.setEnd=function(a){this.end_=a};jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_};jspb.BinaryDecoder.prototype.setCursor=function(a){this.cursor_=a};jspb.BinaryDecoder.prototype.advance=function(a){this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_)};jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_}; +jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_};jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_}; +jspb.BinaryDecoder.prototype.readSplitVarint64_=function(){for(var a,b=0,c,d=0;4>d;d++)if(a=this.bytes_[this.cursor_++],b|=(a&127)<<7*d,128>a){this.tempLow_=b>>>0;this.tempHigh_=0;return}a=this.bytes_[this.cursor_++];b|=(a&127)<<28;c=0|(a&127)>>4;if(128>a)this.tempLow_=b>>>0,this.tempHigh_=c>>>0;else{for(d=0;5>d;d++)if(a=this.bytes_[this.cursor_++],c|=(a&127)<<7*d+3,128>a){this.tempLow_=b>>>0;this.tempHigh_=c>>>0;return}goog.asserts.fail("Failed to read varint, encoding is invalid.");this.error_= +!0}};jspb.BinaryDecoder.prototype.skipVarint=function(){for(;this.bytes_[this.cursor_]&128;)this.cursor_++;this.cursor_++};jspb.BinaryDecoder.prototype.unskipVarint=function(a){for(;128>>=7;this.cursor_--}; +jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var a,b=this.bytes_;a=b[this.cursor_+0];var c=a&127;if(128>a)return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+1];c|=(a&127)<<7;if(128>a)return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+2];c|=(a&127)<<14;if(128>a)return this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+3];c|=(a&127)<<21;if(128>a)return this.cursor_+=4,goog.asserts.assert(this.cursor_<= +this.end_),c;a=b[this.cursor_+4];c|=(a&15)<<28;if(128>a)return this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),c>>>0;this.cursor_+=5;128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&goog.asserts.assert(!1);goog.asserts.assert(this.cursor_<=this.end_);return c};jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32;jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()}; +jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()};jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var a=this.readUnsignedVarint32();return a>>>1^-(a&1)};jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinUint64(this.tempLow_,this.tempHigh_)}; +jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinUnsignedDecimalString(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinInt64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinSignedDecimalString(this.tempLow_,this.tempHigh_)}; +jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinZigzag64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readZigzagVarint64().toString()};jspb.BinaryDecoder.prototype.readUint8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a}; +jspb.BinaryDecoder.prototype.readUint16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8};jspb.BinaryDecoder.prototype.readUint32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8|c<<16|d<<24)>>>0}; +jspb.BinaryDecoder.prototype.readUint64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUint64(a,b)};jspb.BinaryDecoder.prototype.readUint64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUnsignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readInt8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a<<24>>24}; +jspb.BinaryDecoder.prototype.readInt16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8)<<16>>16};jspb.BinaryDecoder.prototype.readInt32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8|c<<16|d<<24}; +jspb.BinaryDecoder.prototype.readInt64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinInt64(a,b)};jspb.BinaryDecoder.prototype.readInt64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinSignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readFloat=function(){var a=this.readUint32();return jspb.utils.joinFloat32(a,0)}; +jspb.BinaryDecoder.prototype.readDouble=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinFloat64(a,b)};jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]};jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()}; +jspb.BinaryDecoder.prototype.readString=function(a){var b=this.bytes_,c=this.cursor_;a=c+a;for(var d=[],e="";cf)d.push(f);else if(192>f)continue;else if(224>f){var g=b[c++];d.push((f&31)<<6|g&63)}else if(240>f){var g=b[c++],h=b[c++];d.push((f&15)<<12|(g&63)<<6|h&63)}else if(248>f){var g=b[c++],h=b[c++],k=b[c++],f=(f&7)<<18|(g&63)<<12|(h&63)<<6|k&63,f=f-65536;d.push((f>>10&1023)+55296,(f&1023)+56320)}8192<=d.length&&(e+=String.fromCharCode.apply(null,d),d.length=0)}e+=goog.crypt.byteArrayToString(d); +this.cursor_=c;return e};jspb.BinaryDecoder.prototype.readStringWithLength=function(){var a=this.readUnsignedVarint32();return this.readString(a)};jspb.BinaryDecoder.prototype.readBytes=function(a){if(0>a||this.cursor_+a>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var b=this.bytes_.subarray(this.cursor_,this.cursor_+a);this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_);return b}; +jspb.BinaryDecoder.prototype.readVarintHash64=function(){this.readSplitVarint64_();return jspb.utils.joinHash64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readFixedHash64=function(){var a=this.bytes_,b=this.cursor_,c=a[b+0],d=a[b+1],e=a[b+2],f=a[b+3],g=a[b+4],h=a[b+5],k=a[b+6],a=a[b+7];this.cursor_+=8;return String.fromCharCode(c,d,e,f,g,h,k,a)};jspb.BinaryReader=function(a,b,c){this.decoder_=jspb.BinaryDecoder.alloc(a,b,c);this.fieldCursor_=this.decoder_.getCursor();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null};jspb.BinaryReader.instanceCache_=[]; +jspb.BinaryReader.alloc=function(a,b,c){if(jspb.BinaryReader.instanceCache_.length){var d=jspb.BinaryReader.instanceCache_.pop();a&&d.decoder_.setBlock(a,b,c);return d}return new jspb.BinaryReader(a,b,c)};jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc; +jspb.BinaryReader.prototype.free=function(){this.decoder_.clear();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null;100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)};jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_};jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()}; +jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()};jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_};jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_};jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP};jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()}; +jspb.BinaryReader.prototype.setBlock=function(a,b,c){this.decoder_.setBlock(a,b,c);this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.advance=function(a){this.decoder_.advance(a)}; +jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var a=this.decoder_.readUnsignedVarint32(),b=a>>>3,a=a&7;if(a!=jspb.BinaryConstants.WireType.VARINT&&a!=jspb.BinaryConstants.WireType.FIXED32&&a!=jspb.BinaryConstants.WireType.FIXED64&&a!=jspb.BinaryConstants.WireType.DELIMITED&&a!=jspb.BinaryConstants.WireType.START_GROUP&&a!=jspb.BinaryConstants.WireType.END_GROUP)return goog.asserts.fail("Invalid wire type: %s (at position %s)", +a,this.fieldCursor_),this.error_=!0,!1;this.nextField_=b;this.nextWireType_=a;return!0};jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)};jspb.BinaryReader.prototype.skipMatchingFields=function(){var a=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==a;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()}; +jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()};jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var a=this.decoder_.readUnsignedVarint32();this.decoder_.advance(a)}}; +jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)};jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)}; +jspb.BinaryReader.prototype.skipGroup=function(){var a=this.nextField_;do{if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF");this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=a&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}while(1)}; +jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}}; +jspb.BinaryReader.prototype.registerReadCallback=function(a,b){goog.isNull(this.readCallbacks_)&&(this.readCallbacks_={});goog.asserts.assert(!this.readCallbacks_[a]);this.readCallbacks_[a]=b};jspb.BinaryReader.prototype.runReadCallback=function(a){goog.asserts.assert(!goog.isNull(this.readCallbacks_));a=this.readCallbacks_[a];goog.asserts.assert(a);return a(this)}; +jspb.BinaryReader.prototype.readAny=function(a){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(a);var b=jspb.BinaryConstants.FieldType;switch(a){case b.DOUBLE:return this.readDouble();case b.FLOAT:return this.readFloat();case b.INT64:return this.readInt64();case b.UINT64:return this.readUint64();case b.INT32:return this.readInt32();case b.FIXED64:return this.readFixed64();case b.FIXED32:return this.readFixed32();case b.BOOL:return this.readBool();case b.STRING:return this.readString(); +case b.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case b.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case b.BYTES:return this.readBytes();case b.UINT32:return this.readUint32();case b.ENUM:return this.readEnum();case b.SFIXED32:return this.readSfixed32();case b.SFIXED64:return this.readSfixed64();case b.SINT32:return this.readSint32();case b.SINT64:return this.readSint64();case b.FHASH64:return this.readFixedHash64();case b.VHASH64:return this.readVarintHash64(); +default:goog.asserts.fail("Invalid field type in readAny()")}return 0};jspb.BinaryReader.prototype.readMessage=function(a,b){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var c=this.decoder_.getEnd(),d=this.decoder_.readUnsignedVarint32(),d=this.decoder_.getCursor()+d;this.decoder_.setEnd(d);b(a,this);this.decoder_.setCursor(d);this.decoder_.setEnd(c)}; +jspb.BinaryReader.prototype.readGroup=function(a,b,c){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP);goog.asserts.assert(this.nextField_==a);c(b,this);this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)}; +jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var a=this.decoder_.readUnsignedVarint32(),b=this.decoder_.getCursor(),c=b+a,a=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),b,a);this.decoder_.setCursor(c);return a};jspb.BinaryReader.prototype.readInt32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint32()}; +jspb.BinaryReader.prototype.readInt32String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint32String()};jspb.BinaryReader.prototype.readInt64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64()};jspb.BinaryReader.prototype.readInt64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64String()}; +jspb.BinaryReader.prototype.readUint32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint32()};jspb.BinaryReader.prototype.readUint32String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint32String()};jspb.BinaryReader.prototype.readUint64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint64()}; +jspb.BinaryReader.prototype.readUint64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint64String()};jspb.BinaryReader.prototype.readSint32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint32()};jspb.BinaryReader.prototype.readSint64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint64()}; +jspb.BinaryReader.prototype.readSint64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint64String()};jspb.BinaryReader.prototype.readFixed32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readUint32()};jspb.BinaryReader.prototype.readFixed64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readUint64()}; +jspb.BinaryReader.prototype.readFixed64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readUint64String()};jspb.BinaryReader.prototype.readSfixed32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readInt32()};jspb.BinaryReader.prototype.readSfixed32String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readInt32().toString()}; +jspb.BinaryReader.prototype.readSfixed64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readInt64()};jspb.BinaryReader.prototype.readSfixed64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readInt64String()};jspb.BinaryReader.prototype.readFloat=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readFloat()}; +jspb.BinaryReader.prototype.readDouble=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readDouble()};jspb.BinaryReader.prototype.readBool=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return!!this.decoder_.readUnsignedVarint32()};jspb.BinaryReader.prototype.readEnum=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64()}; +jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var a=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(a)};jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var a=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(a)}; +jspb.BinaryReader.prototype.readVarintHash64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readVarintHash64()};jspb.BinaryReader.prototype.readFixedHash64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readFixedHash64()}; +jspb.BinaryReader.prototype.readPackedField_=function(a){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);for(var b=this.decoder_.readUnsignedVarint32(),b=this.decoder_.getCursor()+b,c=[];this.decoder_.getCursor()=a.cmp(c)&&(b=b.add(d),c=c.sub(a)),a=a.rightShift(),d=d.rightShift();return[b,c]};jspb.arith.UInt64.prototype.toString=function(){for(var a="",b=this;!b.zero();)var b=b.div(10),c=b[0],a=b[1].lo+a,b=c;""==a&&(a="0");return a}; jspb.arith.UInt64.fromString=function(a){for(var b=new jspb.arith.UInt64(0,0),c=new jspb.arith.UInt64(0,0),d=0;da[d]||"9">>0>>>0,((this.hi+a.hi&4294967295)>>>0)+(4294967296<=this.lo+a.lo?1:0)>>>0)};jspb.arith.Int64.prototype.sub=function(a){return new jspb.arith.Int64((this.lo-a.lo&4294967295)>>>0>>>0,((this.hi-a.hi&4294967295)>>>0)-(0>this.lo-a.lo?1:0)>>>0)};jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)}; -jspb.arith.Int64.prototype.toString=function(){var a=0!=(this.hi&2147483648),b=new jspb.arith.UInt64(this.lo,this.hi);a&&(b=(new jspb.arith.UInt64(0,0)).sub(b));return(a?"-":"")+b.toString()};jspb.arith.Int64.fromString=function(a){var b=0>>0;a=Math.floor((a-b)/jspb.BinaryConstants.TWO_TO_32)>>>0;jspb.utils.split64Low=b;jspb.utils.split64High=a};jspb.utils.splitInt64=function(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/jspb.BinaryConstants.TWO_TO_32);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295a;a=2*Math.abs(a);jspb.utils.splitUint64(a);a=jspb.utils.split64Low;var c=jspb.utils.split64High;b&&(0==a?0==c?c=a=4294967295:(c--,a=4294967295):a--);jspb.utils.split64Low=a;jspb.utils.split64High=c}; -jspb.utils.splitFloat32=function(a){var b=0>a?1:0;a=b?-a:a;var c;0===a?0<1/a?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648):isNaN(a)?(jspb.utils.split64High=0,jspb.utils.split64Low=2147483647):a>jspb.BinaryConstants.FLOAT32_MAX?(jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|2139095040)>>>0):a>>0):(c=Math.floor(Math.log(a)/ -Math.LN2),a*=Math.pow(2,-c),a=Math.round(a*jspb.BinaryConstants.TWO_TO_23)&8388607,jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|c+127<<23|a)>>>0)}; -jspb.utils.splitFloat64=function(a){var b=0>a?1:0;a=b?-a:a;if(0===a)jspb.utils.split64High=0<1/a?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(a))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(a>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(b<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(a>>0;jspb.utils.split64Low=c>>>0}else{var d= -Math.floor(Math.log(a)/Math.LN2);1024==d&&(d=1023);c=a*Math.pow(2,-d);a=c*jspb.BinaryConstants.TWO_TO_20&1048575;c=c*jspb.BinaryConstants.TWO_TO_52>>>0;jspb.utils.split64High=(b<<31|d+1023<<20|a)>>>0;jspb.utils.split64Low=c}}; -jspb.utils.splitHash64=function(a){var b=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=a.charCodeAt(4),g=a.charCodeAt(5),h=a.charCodeAt(6);a=a.charCodeAt(7);jspb.utils.split64Low=b+(c<<8)+(d<<16)+(e<<24)>>>0;jspb.utils.split64High=f+(g<<8)+(h<<16)+(a<<24)>>>0};jspb.utils.joinUint64=function(a,b){return b*jspb.BinaryConstants.TWO_TO_32+a}; -jspb.utils.joinInt64=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinZigzag64=function(a,b){var c=a&1;a=(a>>>1|b<<31)>>>0;b>>>=1;c&&(a=a+1>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinFloat32=function(a,b){var c=2*(a>>31)+1,d=a>>>23&255,e=a&8388607;return 255==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-149)*e:c*Math.pow(2,d-150)*(e+Math.pow(2,23))}; -jspb.utils.joinFloat64=function(a,b){var c=2*(b>>31)+1,d=b>>>20&2047,e=jspb.BinaryConstants.TWO_TO_32*(b&1048575)+a;return 2047==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-1074)*e:c*Math.pow(2,d-1075)*(e+jspb.BinaryConstants.TWO_TO_52)};jspb.utils.joinHash64=function(a,b){return String.fromCharCode(a>>>0&255,a>>>8&255,a>>>16&255,a>>>24&255,b>>>0&255,b>>>8&255,b>>>16&255,b>>>24&255)};jspb.utils.DIGITS="0123456789abcdef".split(""); -jspb.utils.joinUnsignedDecimalString=function(a,b){function c(a){for(var b=1E7,c=0;7>c;c++){var b=b/10,d=a/b%10>>>0;if(0!=d||h)h=!0,k+=g[d]}}if(2097151>=b)return""+(jspb.BinaryConstants.TWO_TO_32*b+a);var d=(a>>>24|b<<8)>>>0&16777215,e=b>>16&65535,f=(a&16777215)+6777216*d+6710656*e,d=d+8147497*e,e=2*e;1E7<=f&&(d+=Math.floor(f/1E7),f%=1E7);1E7<=d&&(e+=Math.floor(d/1E7),d%=1E7);var g=jspb.utils.DIGITS,h=!1,k="";(e||h)&&c(e);(d||h)&&c(d);(f||h)&&c(f);return k}; -jspb.utils.joinSignedDecimalString=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b+(0==a?1:0)>>>0);var d=jspb.utils.joinUnsignedDecimalString(a,b);return c?"-"+d:d};jspb.utils.hash64ToDecimalString=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinSignedDecimalString(c,d):jspb.utils.joinUnsignedDecimalString(c,d)}; -jspb.utils.hash64ArrayToDecimalStrings=function(a,b){for(var c=Array(a.length),d=0;dc&&(1!==a||0>>8}}function c(){for(var a=0;8>a;a++)e[a]=~e[a]&255}goog.asserts.assert(0c;c++){var d=a.charCodeAt(7-c);b[2*c+2]=jspb.utils.DIGITS[d>>4];b[2*c+3]=jspb.utils.DIGITS[d&15]}return b.join("")};jspb.utils.hexStringToHash64=function(a){a=a.toLowerCase();goog.asserts.assert(18==a.length);goog.asserts.assert("0"==a[0]);goog.asserts.assert("x"==a[1]);for(var b="",c=0;8>c;c++)var d=jspb.utils.DIGITS.indexOf(a[2*c+2]),e=jspb.utils.DIGITS.indexOf(a[2*c+3]),b=String.fromCharCode(16*d+e)+b;return b}; -jspb.utils.hash64ToNumber=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinInt64(c,d):jspb.utils.joinUint64(c,d)};jspb.utils.numberToHash64=function(a){jspb.utils.splitInt64(a);return jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.utils.countVarints=function(a,b,c){for(var d=0,e=b;e>7;return c-b-d}; -jspb.utils.countVarintFields=function(a,b,c,d){var e=0;d=8*d+jspb.BinaryConstants.WireType.VARINT;if(128>d)for(;b>=7}if(a[b++]!=f)break;for(e++;f=a[b++],0!=(f&128););}return e};jspb.utils.countFixedFields_=function(a,b,c,d,e){var f=0;if(128>d)for(;b>=7}if(a[b++]!=g)break;f++;b+=e}return f}; -jspb.utils.countFixed32Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED32,4)};jspb.utils.countFixed64Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED64,8)}; -jspb.utils.countDelimitedFields=function(a,b,c,d){var e=0;for(d=8*d+jspb.BinaryConstants.WireType.DELIMITED;b>=7}if(a[b++]!=f)break;e++;for(var g=0,h=1;f=a[b++],g+=(f&127)*h,h*=128,0!=(f&128););b+=g}return e};jspb.utils.debugBytesToTextFormat=function(a){var b='"';if(a){a=jspb.utils.byteSourceToUint8Array(a);for(var c=0;ca[c]&&(b+="0"),b+=a[c].toString(16)}return b+'"'}; -jspb.utils.debugScalarToTextFormat=function(a){return goog.isString(a)?goog.string.quote(a):a.toString()};jspb.utils.stringToByteArray=function(a){for(var b=new Uint8Array(a.length),c=0;c>>7|b<<25)>>>0,b>>>=7;this.buffer_.push(a)}; jspb.BinaryEncoder.prototype.writeSplitFixed64=function(a,b){goog.asserts.assert(a==Math.floor(a));goog.asserts.assert(b==Math.floor(b));goog.asserts.assert(0<=a&&a>>=7;this.buffer_.push(a)}; @@ -691,61 +748,7 @@ jspb.BinaryWriter.prototype.writePackedSfixed32=function(a,b){if(null!=b&&b.leng jspb.BinaryWriter.prototype.writePackedSfixed64String=function(a,b){if(null!=b&&b.length){this.writeFieldHeader_(a,jspb.BinaryConstants.WireType.DELIMITED);this.encoder_.writeUnsignedVarint32(8*b.length);for(var c=0;cjspb.BinaryIterator.instanceCache_.length&&jspb.BinaryIterator.instanceCache_.push(this)}; -jspb.BinaryIterator.prototype.clear=function(){this.decoder_&&this.decoder_.free();this.elements_=this.nextMethod_=this.decoder_=null;this.cursor_=0;this.nextValue_=null;this.atEnd_=!0};jspb.BinaryIterator.prototype.get=function(){return this.nextValue_};jspb.BinaryIterator.prototype.atEnd=function(){return this.atEnd_}; -jspb.BinaryIterator.prototype.next=function(){var a=this.nextValue_;this.decoder_?this.decoder_.atEnd()?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.nextMethod_.call(this.decoder_):this.elements_&&(this.cursor_==this.elements_.length?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.elements_[this.cursor_++]);return a};jspb.BinaryDecoder=function(a,b,c){this.bytes_=null;this.tempHigh_=this.tempLow_=this.cursor_=this.end_=this.start_=0;this.error_=!1;a&&this.setBlock(a,b,c)}; -jspb.BinaryDecoder.instanceCache_=[];jspb.BinaryDecoder.alloc=function(a,b,c){if(jspb.BinaryDecoder.instanceCache_.length){var d=jspb.BinaryDecoder.instanceCache_.pop();a&&d.setBlock(a,b,c);return d}return new jspb.BinaryDecoder(a,b,c)};jspb.BinaryDecoder.prototype.free=function(){this.clear();100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)};jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)}; -jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null;this.cursor_=this.end_=this.start_=0;this.error_=!1};jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_};jspb.BinaryDecoder.prototype.setBlock=function(a,b,c){this.bytes_=jspb.utils.byteSourceToUint8Array(a);this.start_=goog.isDef(b)?b:0;this.end_=goog.isDef(c)?this.start_+c:this.bytes_.length;this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_}; -jspb.BinaryDecoder.prototype.setEnd=function(a){this.end_=a};jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_};jspb.BinaryDecoder.prototype.setCursor=function(a){this.cursor_=a};jspb.BinaryDecoder.prototype.advance=function(a){this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_)};jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_}; -jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_};jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_}; -jspb.BinaryDecoder.prototype.readSplitVarint64_=function(){for(var a,b=0,c,d=0;4>d;d++)if(a=this.bytes_[this.cursor_++],b|=(a&127)<<7*d,128>a){this.tempLow_=b>>>0;this.tempHigh_=0;return}a=this.bytes_[this.cursor_++];b|=(a&127)<<28;c=0|(a&127)>>4;if(128>a)this.tempLow_=b>>>0,this.tempHigh_=c>>>0;else{for(d=0;5>d;d++)if(a=this.bytes_[this.cursor_++],c|=(a&127)<<7*d+3,128>a){this.tempLow_=b>>>0;this.tempHigh_=c>>>0;return}goog.asserts.fail("Failed to read varint, encoding is invalid.");this.error_= -!0}};jspb.BinaryDecoder.prototype.skipVarint=function(){for(;this.bytes_[this.cursor_]&128;)this.cursor_++;this.cursor_++};jspb.BinaryDecoder.prototype.unskipVarint=function(a){for(;128>>=7;this.cursor_--}; -jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var a,b=this.bytes_;a=b[this.cursor_+0];var c=a&127;if(128>a)return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+1];c|=(a&127)<<7;if(128>a)return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+2];c|=(a&127)<<14;if(128>a)return this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+3];c|=(a&127)<<21;if(128>a)return this.cursor_+=4,goog.asserts.assert(this.cursor_<= -this.end_),c;a=b[this.cursor_+4];c|=(a&15)<<28;if(128>a)return this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),c>>>0;this.cursor_+=5;128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&goog.asserts.assert(!1);goog.asserts.assert(this.cursor_<=this.end_);return c};jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32;jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()}; -jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()};jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var a=this.readUnsignedVarint32();return a>>>1^-(a&1)};jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinUint64(this.tempLow_,this.tempHigh_)}; -jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinUnsignedDecimalString(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinInt64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinSignedDecimalString(this.tempLow_,this.tempHigh_)}; -jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinZigzag64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readZigzagVarint64().toString()};jspb.BinaryDecoder.prototype.readUint8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a}; -jspb.BinaryDecoder.prototype.readUint16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8};jspb.BinaryDecoder.prototype.readUint32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8|c<<16|d<<24)>>>0}; -jspb.BinaryDecoder.prototype.readUint64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUint64(a,b)};jspb.BinaryDecoder.prototype.readUint64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUnsignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readInt8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a<<24>>24}; -jspb.BinaryDecoder.prototype.readInt16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8)<<16>>16};jspb.BinaryDecoder.prototype.readInt32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8|c<<16|d<<24}; -jspb.BinaryDecoder.prototype.readInt64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinInt64(a,b)};jspb.BinaryDecoder.prototype.readInt64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinSignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readFloat=function(){var a=this.readUint32();return jspb.utils.joinFloat32(a,0)}; -jspb.BinaryDecoder.prototype.readDouble=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinFloat64(a,b)};jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]};jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()}; -jspb.BinaryDecoder.prototype.readString=function(a){var b=this.bytes_,c=this.cursor_;a=c+a;for(var d=[],e="";cf)d.push(f);else if(192>f)continue;else if(224>f){var g=b[c++];d.push((f&31)<<6|g&63)}else if(240>f){var g=b[c++],h=b[c++];d.push((f&15)<<12|(g&63)<<6|h&63)}else if(248>f){var g=b[c++],h=b[c++],k=b[c++],f=(f&7)<<18|(g&63)<<12|(h&63)<<6|k&63,f=f-65536;d.push((f>>10&1023)+55296,(f&1023)+56320)}8192<=d.length&&(e+=String.fromCharCode.apply(null,d),d.length=0)}e+=goog.crypt.byteArrayToString(d); -this.cursor_=c;return e};jspb.BinaryDecoder.prototype.readStringWithLength=function(){var a=this.readUnsignedVarint32();return this.readString(a)};jspb.BinaryDecoder.prototype.readBytes=function(a){if(0>a||this.cursor_+a>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var b=this.bytes_.subarray(this.cursor_,this.cursor_+a);this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_);return b}; -jspb.BinaryDecoder.prototype.readVarintHash64=function(){this.readSplitVarint64_();return jspb.utils.joinHash64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readFixedHash64=function(){var a=this.bytes_,b=this.cursor_,c=a[b+0],d=a[b+1],e=a[b+2],f=a[b+3],g=a[b+4],h=a[b+5],k=a[b+6],a=a[b+7];this.cursor_+=8;return String.fromCharCode(c,d,e,f,g,h,k,a)};jspb.BinaryReader=function(a,b,c){this.decoder_=jspb.BinaryDecoder.alloc(a,b,c);this.fieldCursor_=this.decoder_.getCursor();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null};jspb.BinaryReader.instanceCache_=[]; -jspb.BinaryReader.alloc=function(a,b,c){if(jspb.BinaryReader.instanceCache_.length){var d=jspb.BinaryReader.instanceCache_.pop();a&&d.decoder_.setBlock(a,b,c);return d}return new jspb.BinaryReader(a,b,c)};jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc; -jspb.BinaryReader.prototype.free=function(){this.decoder_.clear();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null;100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)};jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_};jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()}; -jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()};jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_};jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_};jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP};jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()}; -jspb.BinaryReader.prototype.setBlock=function(a,b,c){this.decoder_.setBlock(a,b,c);this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.advance=function(a){this.decoder_.advance(a)}; -jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var a=this.decoder_.readUnsignedVarint32(),b=a>>>3,a=a&7;if(a!=jspb.BinaryConstants.WireType.VARINT&&a!=jspb.BinaryConstants.WireType.FIXED32&&a!=jspb.BinaryConstants.WireType.FIXED64&&a!=jspb.BinaryConstants.WireType.DELIMITED&&a!=jspb.BinaryConstants.WireType.START_GROUP&&a!=jspb.BinaryConstants.WireType.END_GROUP)return goog.asserts.fail("Invalid wire type"), -this.error_=!0,!1;this.nextField_=b;this.nextWireType_=a;return!0};jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)};jspb.BinaryReader.prototype.skipMatchingFields=function(){var a=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==a;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()}; -jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()};jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var a=this.decoder_.readUnsignedVarint32();this.decoder_.advance(a)}}; -jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)};jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)}; -jspb.BinaryReader.prototype.skipGroup=function(){var a=[this.nextField_];do{if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF");this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP)a.push(this.nextField_);else if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP&&this.nextField_!=a.pop()){goog.asserts.fail("Unmatched end-group tag");this.error_=!0;break}}while(0 K_MAX_LENGTH) { - throw new RangeError('Invalid typed array length') + throw new RangeError('The value "' + length + '" is invalid for option "size"') } // Return an augmented `Uint8Array` instance var buf = new Uint8Array(length) @@ -999,8 +1001,8 @@ function Buffer (arg, encodingOrOffset, length) { // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' + throw new TypeError( + 'The "string" argument must be of type string. Received type number' ) } return allocUnsafe(arg) @@ -1009,7 +1011,7 @@ function Buffer (arg, encodingOrOffset, length) { } // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 -if (typeof Symbol !== 'undefined' && Symbol.species && +if (typeof Symbol !== 'undefined' && Symbol.species != null && Buffer[Symbol.species] === Buffer) { Object.defineProperty(Buffer, Symbol.species, { value: null, @@ -1022,19 +1024,51 @@ if (typeof Symbol !== 'undefined' && Symbol.species && Buffer.poolSize = 8192 // not used by this implementation function from (value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (isArrayBuffer(value) || (value && isArrayBuffer(value.buffer))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - if (typeof value === 'string') { return fromString(value, encodingOrOffset) } - return fromObject(value) + if (ArrayBuffer.isView(value)) { + return fromArrayLike(value) + } + + if (value == null) { + throw TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } + + var valueOf = value.valueOf && value.valueOf() + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } + + var b = fromObject(value) + if (b) return b + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from( + value[Symbol.toPrimitive]('string'), encodingOrOffset, length + ) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) } /** @@ -1058,7 +1092,7 @@ function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be of type number') } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') + throw new RangeError('The value "' + size + '" is invalid for option "size"') } } @@ -1173,20 +1207,16 @@ function fromObject (obj) { return buf } - if (obj) { - if (ArrayBuffer.isView(obj) || 'length' in obj) { - if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { - return createBuffer(0) - } - return fromArrayLike(obj) - } - - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - return fromArrayLike(obj.data) + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) } + return fromArrayLike(obj) } - throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.') + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } } function checked (length) { @@ -1207,12 +1237,17 @@ function SlowBuffer (length) { } Buffer.isBuffer = function isBuffer (b) { - return b != null && b._isBuffer === true + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false } Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError('Arguments must be Buffers') + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) } if (a === b) return 0 @@ -1273,7 +1308,7 @@ Buffer.concat = function concat (list, length) { var pos = 0 for (i = 0; i < list.length; ++i) { var buf = list[i] - if (ArrayBuffer.isView(buf)) { + if (isInstance(buf, Uint8Array)) { buf = Buffer.from(buf) } if (!Buffer.isBuffer(buf)) { @@ -1289,15 +1324,19 @@ function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } - if (ArrayBuffer.isView(string) || isArrayBuffer(string)) { + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { return string.byteLength } if (typeof string !== 'string') { - string = '' + string + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) } var len = string.length - if (len === 0) return 0 + var mustMatch = (arguments.length > 2 && arguments[2] === true) + if (!mustMatch && len === 0) return 0 // Use a for loop to avoid recursion var loweredCase = false @@ -1309,7 +1348,6 @@ function byteLength (string, encoding) { return len case 'utf8': case 'utf-8': - case undefined: return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': @@ -1321,7 +1359,9 @@ function byteLength (string, encoding) { case 'base64': return base64ToBytes(string).length default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } encoding = ('' + encoding).toLowerCase() loweredCase = true } @@ -1468,16 +1508,20 @@ Buffer.prototype.equals = function equals (b) { Buffer.prototype.inspect = function inspect () { var str = '' var max = exports.INSPECT_MAX_BYTES - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') - if (this.length > max) str += ' ... ' - } + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() + if (this.length > max) str += ' ... ' return '' } Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength) + } if (!Buffer.isBuffer(target)) { - throw new TypeError('Argument must be a Buffer') + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) } if (start === undefined) { @@ -1556,7 +1600,7 @@ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } - byteOffset = +byteOffset // Coerce to Number. + byteOffset = +byteOffset // Coerce to Number. if (numberIsNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : (buffer.length - 1) @@ -1808,8 +1852,8 @@ function utf8Slice (buf, start, end) { var codePoint = null var bytesPerSequence = (firstByte > 0xEF) ? 4 : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 + : (firstByte > 0xBF) ? 2 + : 1 if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint @@ -2472,7 +2516,7 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) { } else { var bytes = Buffer.isBuffer(val) ? val - : new Buffer(val, encoding) + : Buffer.from(val, encoding) var len = bytes.length if (len === 0) { throw new TypeError('The value "' + val + @@ -2627,19 +2671,21 @@ function blitBuffer (src, dst, offset, length) { return i } -// ArrayBuffers from another context (i.e. an iframe) do not pass the `instanceof` check -// but they should be treated as valid. See: https://github.com/feross/buffer/issues/166 -function isArrayBuffer (obj) { - return obj instanceof ArrayBuffer || - (obj != null && obj.constructor != null && obj.constructor.name === 'ArrayBuffer' && - typeof obj.byteLength === 'number') +// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass +// the `instanceof` check but they should be treated as of that type. +// See: https://github.com/feross/buffer/issues/166 +function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) } - function numberIsNaN (obj) { + // For IE11 support return obj !== obj // eslint-disable-line no-self-compare } -},{"base64-js":4,"ieee754":6}],6:[function(require,module,exports){ +}).call(this,require("buffer").Buffer) +},{"base64-js":4,"buffer":5,"ieee754":6}],6:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 diff --git a/cim_for_mina/cim-client-android/.idea/caches/build_file_checksums.ser b/cim_for_mina/cim-client-android/.idea/caches/build_file_checksums.ser index f1c6ebd..faae9f8 100644 Binary files a/cim_for_mina/cim-client-android/.idea/caches/build_file_checksums.ser and b/cim_for_mina/cim-client-android/.idea/caches/build_file_checksums.ser differ diff --git a/cim_for_mina/cim-client-android/.idea/caches/gradle_models.ser b/cim_for_mina/cim-client-android/.idea/caches/gradle_models.ser index 743e768..85963de 100644 Binary files a/cim_for_mina/cim-client-android/.idea/caches/gradle_models.ser and b/cim_for_mina/cim-client-android/.idea/caches/gradle_models.ser differ diff --git a/cim_for_mina/cim-client-android/.idea/misc.xml b/cim_for_mina/cim-client-android/.idea/misc.xml index af0bbdd..703e5d4 100644 --- a/cim_for_mina/cim-client-android/.idea/misc.xml +++ b/cim_for_mina/cim-client-android/.idea/misc.xml @@ -5,7 +5,7 @@ - + diff --git a/cim_for_mina/cim-client-android/app/libs/cim-android-sdk-3.6.jar b/cim_for_mina/cim-client-android/app/libs/cim-android-sdk-3.6.jar index f957a8b..a6debce 100644 Binary files a/cim_for_mina/cim-client-android/app/libs/cim-android-sdk-3.6.jar and b/cim_for_mina/cim-client-android/app/libs/cim-android-sdk-3.6.jar differ diff --git a/cim_for_mina/cim-client-android/app/src/main/AndroidManifest.xml b/cim_for_mina/cim-client-android/app/src/main/AndroidManifest.xml index 8401962..69fcb1a 100644 --- a/cim_for_mina/cim-client-android/app/src/main/AndroidManifest.xml +++ b/cim_for_mina/cim-client-android/app/src/main/AndroidManifest.xml @@ -52,7 +52,7 @@ @@ -61,7 +61,8 @@ - + + diff --git a/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SplanshActivity.java b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SplanshActivity.java index bb890b3..07859be 100644 --- a/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SplanshActivity.java +++ b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SplanshActivity.java @@ -22,13 +22,20 @@ package com.farsunset.ichat.example.ui; +import android.content.Context; import android.content.Intent; +import android.net.ConnectivityManager; +import android.net.Network; +import android.net.NetworkRequest; +import android.os.Build; import android.os.Bundle; +import android.support.annotation.RequiresApi; import android.view.View; import android.view.animation.AlphaAnimation; import android.widget.Toast; import com.farsunset.cim.sdk.android.CIMPushManager; +import com.farsunset.cim.sdk.android.constant.CIMConstant; import com.farsunset.ichat.example.BuildConfig; import com.farsunset.ichat.example.R; import com.farsunset.ichat.example.app.CIMMonitorActivity; @@ -37,6 +44,7 @@ import com.farsunset.ichat.example.app.Constant; public class SplanshActivity extends CIMMonitorActivity { + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public void onCreate(Bundle savedInstanceState) { diff --git a/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java index ed0aa1f..3955423 100644 --- a/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java +++ b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java @@ -90,11 +90,9 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick startActivity(intent); this.finish(); } else { - MediaPlayer.create(this, R.raw.classic).start(); list.add(message); adapter.notifyDataSetChanged(); chatListView.setSelection(chatListView.getTop()); - } } diff --git a/cim_for_mina/cim-client-android/app/src/main/res/raw/classic.mp3 b/cim_for_mina/cim-client-android/app/src/main/res/raw/classic.mp3 deleted file mode 100644 index 36412c0..0000000 Binary files a/cim_for_mina/cim-client-android/app/src/main/res/raw/classic.mp3 and /dev/null differ diff --git a/cim_for_mina/cim-java-sdk/.classpath b/cim_for_mina/cim-java-sdk/.classpath index 742d1ff..153238c 100644 --- a/cim_for_mina/cim-java-sdk/.classpath +++ b/cim_for_mina/cim-java-sdk/.classpath @@ -6,6 +6,6 @@ - + diff --git a/cim_for_mina/cim-java-sdk/libs/protobuf-java-3.2.0.jar b/cim_for_mina/cim-java-sdk/libs/protobuf-java-3.2.0.jar deleted file mode 100644 index b1f9701..0000000 Binary files a/cim_for_mina/cim-java-sdk/libs/protobuf-java-3.2.0.jar and /dev/null differ diff --git a/cim_for_mina/cim-java-sdk/libs/protobuf-java-3.7.0.jar b/cim_for_mina/cim-java-sdk/libs/protobuf-java-3.7.0.jar new file mode 100644 index 0000000..eebaefe Binary files /dev/null and b/cim_for_mina/cim-java-sdk/libs/protobuf-java-3.7.0.jar differ diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java index 9f44a2d..a2beb92 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java @@ -102,7 +102,7 @@ public class ClientMessageDecoder extends CumulativeProtocolDecoder { if (CIMConstant.ProtobufType.MESSAGE == type) { MessageProto.Model bodyProto = MessageProto.Model.parseFrom(bytes); Message message = new Message(); - message.setMid(bodyProto.getMid()); + message.setId(bodyProto.getId()); message.setAction(bodyProto.getAction()); message.setContent(bodyProto.getContent()); message.setSender(bodyProto.getSender()); diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java index 70d8b4f..0d08017 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java @@ -33,7 +33,7 @@ public class Message implements Serializable { /** * 消息类型,用户自定义消息类别 */ - private String mid; + private long id; /** * 消息类型,用户自定义消息类别 @@ -72,6 +72,20 @@ public class Message implements Serializable { public Message() { timestamp = System.currentTimeMillis(); } + + + + public long getId() { + return id; + } + + + + public void setId(long id) { + this.id = id; + } + + public long getTimestamp() { return timestamp; @@ -141,7 +155,7 @@ public class Message implements Serializable { StringBuffer buffer = new StringBuffer(); buffer.append("#Message#").append("\n"); - buffer.append("mid:").append(mid).append("\n"); + buffer.append("id:").append(id).append("\n"); buffer.append("action:").append(action).append("\n"); buffer.append("title:").append(title).append("\n"); buffer.append("content:").append(content).append("\n"); @@ -153,13 +167,6 @@ public class Message implements Serializable { return buffer.toString(); } - public String getMid() { - return mid; - } - - public void setMid(String mid) { - this.mid = mid; - } public boolean isNotEmpty(String txt) { return txt != null && txt.trim().length() != 0; diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto index bd6d327..11918a8 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package com.farsunset.cim.sdk.model.proto; option java_outer_classname="MessageProto"; message Model { - string mid = 1; + int64 id = 1; string action = 2; string content = 3; string sender = 4; diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java index d0f7e2c..3cb763d 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java @@ -1,1562 +1,1556 @@ -/** - * Copyright 2013-2019 Xia Jun(3979434@qq.com). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - *************************************************************************************** - * * - * Website : http://www.farsunset.com * - * * - *************************************************************************************** - */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Message.proto + package com.farsunset.cim.sdk.model.proto; public final class MessageProto { - private MessageProto() { - } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - public interface ModelOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.model.proto.Model) - com.google.protobuf.MessageOrBuilder { - - /** - * string mid = 1; - */ - java.lang.String getMid(); - - /** - * string mid = 1; - */ - com.google.protobuf.ByteString getMidBytes(); - - /** - * string action = 2; - */ - java.lang.String getAction(); - - /** - * string action = 2; - */ - com.google.protobuf.ByteString getActionBytes(); - - /** - * string content = 3; - */ - java.lang.String getContent(); - - /** - * string content = 3; - */ - com.google.protobuf.ByteString getContentBytes(); - - /** - * string sender = 4; - */ - java.lang.String getSender(); - - /** - * string sender = 4; - */ - com.google.protobuf.ByteString getSenderBytes(); - - /** - * string receiver = 5; - */ - java.lang.String getReceiver(); - - /** - * string receiver = 5; - */ - com.google.protobuf.ByteString getReceiverBytes(); - - /** - * string extra = 6; - */ - java.lang.String getExtra(); - - /** - * string extra = 6; - */ - com.google.protobuf.ByteString getExtraBytes(); - - /** - * string title = 7; - */ - java.lang.String getTitle(); - - /** - * string title = 7; - */ - com.google.protobuf.ByteString getTitleBytes(); - - /** - * string format = 8; - */ - java.lang.String getFormat(); - - /** - * string format = 8; - */ - com.google.protobuf.ByteString getFormatBytes(); - - /** - * int64 timestamp = 9; - */ - long getTimestamp(); - } - - /** - * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} - */ - public static final class Model extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.model.proto.Model) - ModelOrBuilder { - // Use Model.newBuilder() to construct. - private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Model() { - mid_ = ""; - action_ = ""; - content_ = ""; - sender_ = ""; - receiver_ = ""; - extra_ = ""; - title_ = ""; - format_ = ""; - timestamp_ = 0L; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private Model(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - mid_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - action_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - content_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - sender_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - receiver_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - extra_ = s; - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - title_ = s; - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - format_ = s; - break; - } - case 72: { - - timestamp_ = input.readInt64(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable - .ensureFieldAccessorsInitialized(com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, - com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); - } - - public static final int MID_FIELD_NUMBER = 1; - private volatile java.lang.Object mid_; - - /** - * string mid = 1; - */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } - } - - /** - * string mid = 1; - */ - public com.google.protobuf.ByteString getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ACTION_FIELD_NUMBER = 2; - private volatile java.lang.Object action_; - - /** - * string action = 2; - */ - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } - } - - /** - * string action = 2; - */ - public com.google.protobuf.ByteString getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONTENT_FIELD_NUMBER = 3; - private volatile java.lang.Object content_; - - /** - * string content = 3; - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } - } - - /** - * string content = 3; - */ - public com.google.protobuf.ByteString getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SENDER_FIELD_NUMBER = 4; - private volatile java.lang.Object sender_; - - /** - * string sender = 4; - */ - public java.lang.String getSender() { - java.lang.Object ref = sender_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sender_ = s; - return s; - } - } - - /** - * string sender = 4; - */ - public com.google.protobuf.ByteString getSenderBytes() { - java.lang.Object ref = sender_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - sender_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RECEIVER_FIELD_NUMBER = 5; - private volatile java.lang.Object receiver_; - - /** - * string receiver = 5; - */ - public java.lang.String getReceiver() { - java.lang.Object ref = receiver_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - receiver_ = s; - return s; - } - } - - /** - * string receiver = 5; - */ - public com.google.protobuf.ByteString getReceiverBytes() { - java.lang.Object ref = receiver_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - receiver_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EXTRA_FIELD_NUMBER = 6; - private volatile java.lang.Object extra_; - - /** - * string extra = 6; - */ - public java.lang.String getExtra() { - java.lang.Object ref = extra_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - extra_ = s; - return s; - } - } - - /** - * string extra = 6; - */ - public com.google.protobuf.ByteString getExtraBytes() { - java.lang.Object ref = extra_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - extra_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TITLE_FIELD_NUMBER = 7; - private volatile java.lang.Object title_; - - /** - * string title = 7; - */ - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; - } - } - - /** - * string title = 7; - */ - public com.google.protobuf.ByteString getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FORMAT_FIELD_NUMBER = 8; - private volatile java.lang.Object format_; - - /** - * string format = 8; - */ - public java.lang.String getFormat() { - java.lang.Object ref = format_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - format_ = s; - return s; - } - } - - /** - * string format = 8; - */ - public com.google.protobuf.ByteString getFormatBytes() { - java.lang.Object ref = format_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - format_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMP_FIELD_NUMBER = 9; - private long timestamp_; - - /** - * int64 timestamp = 9; - */ - public long getTimestamp() { - return timestamp_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) - return true; - if (isInitialized == 0) - return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getMidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); - } - if (!getActionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); - } - if (!getContentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); - } - if (!getSenderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); - } - if (!getReceiverBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); - } - if (!getExtraBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); - } - if (!getTitleBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); - } - if (!getFormatBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); - } - if (timestamp_ != 0L) { - output.writeInt64(9, timestamp_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) - return size; - - size = 0; - if (!getMidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); - } - if (!getActionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); - } - if (!getContentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); - } - if (!getSenderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); - } - if (!getReceiverBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); - } - if (!getExtraBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); - } - if (!getTitleBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); - } - if (!getFormatBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); - } - if (timestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, timestamp_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model)) { - return super.equals(obj); - } - com.farsunset.cim.sdk.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) obj; - - boolean result = true; - result = result && getMid().equals(other.getMid()); - result = result && getAction().equals(other.getAction()); - result = result && getContent().equals(other.getContent()); - result = result && getSender().equals(other.getSender()); - result = result && getReceiver().equals(other.getReceiver()); - result = result && getExtra().equals(other.getExtra()); - result = result && getTitle().equals(other.getTitle()); - result = result && getFormat().equals(other.getFormat()); - result = result && (getTimestamp() == other.getTimestamp()); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + MID_FIELD_NUMBER; - hash = (53 * hash) + getMid().hashCode(); - hash = (37 * hash) + ACTION_FIELD_NUMBER; - hash = (53 * hash) + getAction().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - hash = (37 * hash) + SENDER_FIELD_NUMBER; - hash = (53 * hash) + getSender().hashCode(); - hash = (37 * hash) + RECEIVER_FIELD_NUMBER; - hash = (53 * hash) + getReceiver().hashCode(); - hash = (37 * hash) + EXTRA_FIELD_NUMBER; - hash = (53 * hash) + getExtra().hashCode(); - hash = (37 * hash) + TITLE_FIELD_NUMBER; - hash = (53 * hash) + getTitle().hashCode(); - hash = (37 * hash) + FORMAT_FIELD_NUMBER; - hash = (53 * hash) + getFormat().hashCode(); - hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTimestamp()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, - extensionRegistry); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.farsunset.cim.sdk.model.proto.MessageProto.Model prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.model.proto.Model) - com.farsunset.cim.sdk.model.proto.MessageProto.ModelOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable - .ensureFieldAccessorsInitialized(com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, - com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); - } - - // Construct using - // com.farsunset.cim.sdk.model.proto.MessageProto.Model.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - } - } - - public Builder clear() { - super.clear(); - mid_ = ""; - - action_ = ""; - - content_ = ""; - - sender_ = ""; - - receiver_ = ""; - - extra_ = ""; - - title_ = ""; - - format_ = ""; - - timestamp_ = 0L; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; - } - - public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { - return com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance(); - } - - public com.farsunset.cim.sdk.model.proto.MessageProto.Model build() { - com.farsunset.cim.sdk.model.proto.MessageProto.Model result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.farsunset.cim.sdk.model.proto.MessageProto.Model buildPartial() { - com.farsunset.cim.sdk.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.model.proto.MessageProto.Model( - this); - result.mid_ = mid_; - result.action_ = action_; - result.content_ = content_; - result.sender_ = sender_; - result.receiver_ = receiver_; - result.extra_ = extra_; - result.title_ = title_; - result.format_ = format_; - result.timestamp_ = timestamp_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, - Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model) { - return mergeFrom((com.farsunset.cim.sdk.model.proto.MessageProto.Model) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.farsunset.cim.sdk.model.proto.MessageProto.Model other) { - if (other == com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance()) - return this; - if (!other.getMid().isEmpty()) { - mid_ = other.mid_; - onChanged(); - } - if (!other.getAction().isEmpty()) { - action_ = other.action_; - onChanged(); - } - if (!other.getContent().isEmpty()) { - content_ = other.content_; - onChanged(); - } - if (!other.getSender().isEmpty()) { - sender_ = other.sender_; - onChanged(); - } - if (!other.getReceiver().isEmpty()) { - receiver_ = other.receiver_; - onChanged(); - } - if (!other.getExtra().isEmpty()) { - extra_ = other.extra_; - onChanged(); - } - if (!other.getTitle().isEmpty()) { - title_ = other.title_; - onChanged(); - } - if (!other.getFormat().isEmpty()) { - format_ = other.format_; - onChanged(); - } - if (other.getTimestamp() != 0L) { - setTimestamp(other.getTimestamp()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.farsunset.cim.sdk.model.proto.MessageProto.Model parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object mid_ = ""; - - /** - * string mid = 1; - */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string mid = 1; - */ - public com.google.protobuf.ByteString getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string mid = 1; - */ - public Builder setMid(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - mid_ = value; - onChanged(); - return this; - } - - /** - * string mid = 1; - */ - public Builder clearMid() { - - mid_ = getDefaultInstance().getMid(); - onChanged(); - return this; - } - - /** - * string mid = 1; - */ - public Builder setMidBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - mid_ = value; - onChanged(); - return this; - } - - private java.lang.Object action_ = ""; - - /** - * string action = 2; - */ - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string action = 2; - */ - public com.google.protobuf.ByteString getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string action = 2; - */ - public Builder setAction(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - action_ = value; - onChanged(); - return this; - } - - /** - * string action = 2; - */ - public Builder clearAction() { - - action_ = getDefaultInstance().getAction(); - onChanged(); - return this; - } - - /** - * string action = 2; - */ - public Builder setActionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - action_ = value; - onChanged(); - return this; - } - - private java.lang.Object content_ = ""; - - /** - * string content = 3; - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string content = 3; - */ - public com.google.protobuf.ByteString getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string content = 3; - */ - public Builder setContent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - - /** - * string content = 3; - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - onChanged(); - return this; - } - - /** - * string content = 3; - */ - public Builder setContentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - content_ = value; - onChanged(); - return this; - } - - private java.lang.Object sender_ = ""; - - /** - * string sender = 4; - */ - public java.lang.String getSender() { - java.lang.Object ref = sender_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sender_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string sender = 4; - */ - public com.google.protobuf.ByteString getSenderBytes() { - java.lang.Object ref = sender_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - sender_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string sender = 4; - */ - public Builder setSender(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - sender_ = value; - onChanged(); - return this; - } - - /** - * string sender = 4; - */ - public Builder clearSender() { - - sender_ = getDefaultInstance().getSender(); - onChanged(); - return this; - } - - /** - * string sender = 4; - */ - public Builder setSenderBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - sender_ = value; - onChanged(); - return this; - } - - private java.lang.Object receiver_ = ""; - - /** - * string receiver = 5; - */ - public java.lang.String getReceiver() { - java.lang.Object ref = receiver_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - receiver_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string receiver = 5; - */ - public com.google.protobuf.ByteString getReceiverBytes() { - java.lang.Object ref = receiver_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - receiver_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string receiver = 5; - */ - public Builder setReceiver(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - receiver_ = value; - onChanged(); - return this; - } - - /** - * string receiver = 5; - */ - public Builder clearReceiver() { - - receiver_ = getDefaultInstance().getReceiver(); - onChanged(); - return this; - } - - /** - * string receiver = 5; - */ - public Builder setReceiverBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - receiver_ = value; - onChanged(); - return this; - } - - private java.lang.Object extra_ = ""; - - /** - * string extra = 6; - */ - public java.lang.String getExtra() { - java.lang.Object ref = extra_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - extra_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string extra = 6; - */ - public com.google.protobuf.ByteString getExtraBytes() { - java.lang.Object ref = extra_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - extra_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string extra = 6; - */ - public Builder setExtra(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - extra_ = value; - onChanged(); - return this; - } - - /** - * string extra = 6; - */ - public Builder clearExtra() { - - extra_ = getDefaultInstance().getExtra(); - onChanged(); - return this; - } - - /** - * string extra = 6; - */ - public Builder setExtraBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - extra_ = value; - onChanged(); - return this; - } - - private java.lang.Object title_ = ""; - - /** - * string title = 7; - */ - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string title = 7; - */ - public com.google.protobuf.ByteString getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string title = 7; - */ - public Builder setTitle(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - title_ = value; - onChanged(); - return this; - } - - /** - * string title = 7; - */ - public Builder clearTitle() { - - title_ = getDefaultInstance().getTitle(); - onChanged(); - return this; - } - - /** - * string title = 7; - */ - public Builder setTitleBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - title_ = value; - onChanged(); - return this; - } - - private java.lang.Object format_ = ""; - - /** - * string format = 8; - */ - public java.lang.String getFormat() { - java.lang.Object ref = format_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - format_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string format = 8; - */ - public com.google.protobuf.ByteString getFormatBytes() { - java.lang.Object ref = format_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - format_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string format = 8; - */ - public Builder setFormat(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - format_ = value; - onChanged(); - return this; - } - - /** - * string format = 8; - */ - public Builder clearFormat() { - - format_ = getDefaultInstance().getFormat(); - onChanged(); - return this; - } - - /** - * string format = 8; - */ - public Builder setFormatBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - format_ = value; - onChanged(); - return this; - } - - private long timestamp_; - - /** - * int64 timestamp = 9; - */ - public long getTimestamp() { - return timestamp_; - } - - /** - * int64 timestamp = 9; - */ - public Builder setTimestamp(long value) { - - timestamp_ = value; - onChanged(); - return this; - } - - /** - * int64 timestamp = 9; - */ - public Builder clearTimestamp() { - - timestamp_ = 0L; - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.model.proto.Model) - } - - // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.model.proto.Model) - private static final com.farsunset.cim.sdk.model.proto.MessageProto.Model DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.farsunset.cim.sdk.model.proto.MessageProto.Model(); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - public Model parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Model(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - static { - java.lang.String[] descriptorData = { "\n\rMessage.proto\022!com.farsunset.cim.sdk.m" - + "odel.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(\t\022\016\n\006act" - + "ion\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sender\030\004 \001" - + "(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001(\t\022\r\n\005t" - + "itle\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttimestamp\030" - + "\t \001(\003B\016B\014MessageProtob\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); - internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor, new java.lang.String[] { "Mid", - "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); - } - - // @@protoc_insertion_point(outer_class_scope) + private MessageProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 id = 1; + */ + long getId(); + + /** + * string action = 2; + */ + java.lang.String getAction(); + /** + * string action = 2; + */ + com.google.protobuf.ByteString + getActionBytes(); + + /** + * string content = 3; + */ + java.lang.String getContent(); + /** + * string content = 3; + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * string sender = 4; + */ + java.lang.String getSender(); + /** + * string sender = 4; + */ + com.google.protobuf.ByteString + getSenderBytes(); + + /** + * string receiver = 5; + */ + java.lang.String getReceiver(); + /** + * string receiver = 5; + */ + com.google.protobuf.ByteString + getReceiverBytes(); + + /** + * string extra = 6; + */ + java.lang.String getExtra(); + /** + * string extra = 6; + */ + com.google.protobuf.ByteString + getExtraBytes(); + + /** + * string title = 7; + */ + java.lang.String getTitle(); + /** + * string title = 7; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string format = 8; + */ + java.lang.String getFormat(); + /** + * string format = 8; + */ + com.google.protobuf.ByteString + getFormatBytes(); + + /** + * int64 timestamp = 9; + */ + long getTimestamp(); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.model.proto.Model) + ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + action_ = ""; + content_ = ""; + sender_ = ""; + receiver_ = ""; + extra_ = ""; + title_ = ""; + format_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + id_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + sender_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + receiver_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + extra_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 72: { + + timestamp_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + * int64 id = 1; + */ + public long getId() { + return id_; + } + + public static final int ACTION_FIELD_NUMBER = 2; + private volatile java.lang.Object action_; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private volatile java.lang.Object content_; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SENDER_FIELD_NUMBER = 4; + private volatile java.lang.Object sender_; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECEIVER_FIELD_NUMBER = 5; + private volatile java.lang.Object receiver_; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTRA_FIELD_NUMBER = 6; + private volatile java.lang.Object extra_; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 7; + private volatile java.lang.Object title_; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 8; + private volatile java.lang.Object format_; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private long timestamp_; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (!getSenderBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); + } + if (!getFormatBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); + } + if (timestamp_ != 0L) { + output.writeInt64(9, timestamp_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (!getSenderBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); + } + if (!getFormatBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, timestamp_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) obj; + + if (getId() + != other.getId()) return false; + if (!getAction() + .equals(other.getAction())) return false; + if (!getContent() + .equals(other.getContent())) return false; + if (!getSender() + .equals(other.getSender())) return false; + if (!getReceiver() + .equals(other.getReceiver())) return false; + if (!getExtra() + .equals(other.getExtra())) return false; + if (!getTitle() + .equals(other.getTitle())) return false; + if (!getFormat() + .equals(other.getFormat())) return false; + if (getTimestamp() + != other.getTimestamp()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SENDER_FIELD_NUMBER; + hash = (53 * hash) + getSender().hashCode(); + hash = (37 * hash) + RECEIVER_FIELD_NUMBER; + hash = (53 * hash) + getReceiver().hashCode(); + hash = (37 * hash) + EXTRA_FIELD_NUMBER; + hash = (53 * hash) + getExtra().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.model.proto.MessageProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.model.proto.Model) + com.farsunset.cim.sdk.model.proto.MessageProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.model.proto.MessageProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = 0L; + + action_ = ""; + + content_ = ""; + + sender_ = ""; + + receiver_ = ""; + + extra_ = ""; + + title_ = ""; + + format_ = ""; + + timestamp_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @java.lang.Override + public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance(); + } + + @java.lang.Override + public com.farsunset.cim.sdk.model.proto.MessageProto.Model build() { + com.farsunset.cim.sdk.model.proto.MessageProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.farsunset.cim.sdk.model.proto.MessageProto.Model buildPartial() { + com.farsunset.cim.sdk.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.model.proto.MessageProto.Model(this); + result.id_ = id_; + result.action_ = action_; + result.content_ = content_; + result.sender_ = sender_; + result.receiver_ = receiver_; + result.extra_ = extra_; + result.title_ = title_; + result.format_ = format_; + result.timestamp_ = timestamp_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.model.proto.MessageProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.model.proto.MessageProto.Model other) { + if (other == com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getSender().isEmpty()) { + sender_ = other.sender_; + onChanged(); + } + if (!other.getReceiver().isEmpty()) { + receiver_ = other.receiver_; + onChanged(); + } + if (!other.getExtra().isEmpty()) { + extra_ = other.extra_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.model.proto.MessageProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long id_ ; + /** + * int64 id = 1; + */ + public long getId() { + return id_; + } + /** + * int64 id = 1; + */ + public Builder setId(long value) { + + id_ = value; + onChanged(); + return this; + } + /** + * int64 id = 1; + */ + public Builder clearId() { + + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string action = 2; + */ + public Builder setAction( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder setActionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object sender_ = ""; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sender = 4; + */ + public Builder setSender( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sender_ = value; + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder clearSender() { + + sender_ = getDefaultInstance().getSender(); + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder setSenderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sender_ = value; + onChanged(); + return this; + } + + private java.lang.Object receiver_ = ""; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string receiver = 5; + */ + public Builder setReceiver( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + receiver_ = value; + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder clearReceiver() { + + receiver_ = getDefaultInstance().getReceiver(); + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder setReceiverBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + receiver_ = value; + onChanged(); + return this; + } + + private java.lang.Object extra_ = ""; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string extra = 6; + */ + public Builder setExtra( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + extra_ = value; + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder clearExtra() { + + extra_ = getDefaultInstance().getExtra(); + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder setExtraBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + extra_ = value; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 7; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object format_ = ""; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string format = 8; + */ + public Builder setFormat( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder setFormatBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 9; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 9; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.model.proto.Model) + private static final com.farsunset.cim.sdk.model.proto.MessageProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.model.proto.MessageProto.Model(); + } + + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rMessage.proto\022!com.farsunset.cim.sdk.m" + + "odel.proto\"\227\001\n\005Model\022\n\n\002id\030\001 \001(\003\022\016\n\006acti" + + "on\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sender\030\004 \001(" + + "\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001(\t\022\r\n\005ti" + + "tle\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttimestamp\030\t" + + " \001(\003B\016B\014MessageProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor, + new java.lang.String[] { "Id", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/cim_for_mina/cim-server-sdk/.classpath b/cim_for_mina/cim-server-sdk/.classpath index 3430be1..508ecfa 100644 --- a/cim_for_mina/cim-server-sdk/.classpath +++ b/cim_for_mina/cim-server-sdk/.classpath @@ -2,12 +2,12 @@ - + diff --git a/cim_for_mina/cim-server-sdk/libs/protobuf-java-3.2.0.jar b/cim_for_mina/cim-server-sdk/libs/protobuf-java-3.2.0.jar deleted file mode 100644 index b1f9701..0000000 Binary files a/cim_for_mina/cim-server-sdk/libs/protobuf-java-3.2.0.jar and /dev/null differ diff --git a/cim_for_mina/cim-server-sdk/libs/protobuf-java-3.7.0.jar b/cim_for_mina/cim-server-sdk/libs/protobuf-java-3.7.0.jar new file mode 100644 index 0000000..eebaefe Binary files /dev/null and b/cim_for_mina/cim-server-sdk/libs/protobuf-java-3.7.0.jar differ diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java index c9b095c..c271927 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java @@ -36,7 +36,7 @@ public class Message implements Serializable, EncodeFormatable { /** * 消息类型,用户自定义消息类别 */ - private String mid; + private long id; /** * 消息类型,用户自定义消息类别 @@ -76,6 +76,17 @@ public class Message implements Serializable, EncodeFormatable { timestamp = System.currentTimeMillis(); } + + public long getId() { + return id; + } + + + public void setId(long id) { + this.id = id; + } + + public long getTimestamp() { return timestamp; } @@ -140,19 +151,11 @@ public class Message implements Serializable, EncodeFormatable { this.extra = extra; } - public String getMid() { - return mid; - } - - public void setMid(String mid) { - this.mid = mid; - } - @Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("#Message#").append("\n"); - buffer.append("mid:").append(mid).append("\n"); + buffer.append("id:").append(id).append("\n"); buffer.append("action:").append(action).append("\n"); buffer.append("title:").append(title).append("\n"); buffer.append("content:").append(content).append("\n"); @@ -171,7 +174,7 @@ public class Message implements Serializable, EncodeFormatable { @Override public byte[] getProtobufBody() { MessageProto.Model.Builder builder = MessageProto.Model.newBuilder(); - builder.setMid(mid); + builder.setId(id); builder.setAction(action); builder.setSender(sender); builder.setReceiver(receiver); diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto index 677e574..69d9589 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package com.farsunset.cim.sdk.server.model.proto; option java_outer_classname="MessageProto"; message Model { - string mid = 1; + int64 id = 1; string action = 2; string content = 3; string sender = 4; diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java index 8aa073c..bf807e3 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java @@ -1,1566 +1,1556 @@ -/** - * Copyright 2013-2019 Xia Jun(3979434@qq.com). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - *************************************************************************************** - * * - * Website : http://www.farsunset.com * - * * - *************************************************************************************** - */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Message.proto + package com.farsunset.cim.sdk.server.model.proto; public final class MessageProto { - private MessageProto() { - } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - public interface ModelOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.server.model.proto.Model) - com.google.protobuf.MessageOrBuilder { - - /** - * string mid = 1; - */ - java.lang.String getMid(); - - /** - * string mid = 1; - */ - com.google.protobuf.ByteString getMidBytes(); - - /** - * string action = 2; - */ - java.lang.String getAction(); - - /** - * string action = 2; - */ - com.google.protobuf.ByteString getActionBytes(); - - /** - * string content = 3; - */ - java.lang.String getContent(); - - /** - * string content = 3; - */ - com.google.protobuf.ByteString getContentBytes(); - - /** - * string sender = 4; - */ - java.lang.String getSender(); - - /** - * string sender = 4; - */ - com.google.protobuf.ByteString getSenderBytes(); - - /** - * string receiver = 5; - */ - java.lang.String getReceiver(); - - /** - * string receiver = 5; - */ - com.google.protobuf.ByteString getReceiverBytes(); - - /** - * string extra = 6; - */ - java.lang.String getExtra(); - - /** - * string extra = 6; - */ - com.google.protobuf.ByteString getExtraBytes(); - - /** - * string title = 7; - */ - java.lang.String getTitle(); - - /** - * string title = 7; - */ - com.google.protobuf.ByteString getTitleBytes(); - - /** - * string format = 8; - */ - java.lang.String getFormat(); - - /** - * string format = 8; - */ - com.google.protobuf.ByteString getFormatBytes(); - - /** - * int64 timestamp = 9; - */ - long getTimestamp(); - } - - /** - * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} - */ - public static final class Model extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.server.model.proto.Model) - ModelOrBuilder { - // Use Model.newBuilder() to construct. - private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Model() { - mid_ = ""; - action_ = ""; - content_ = ""; - sender_ = ""; - receiver_ = ""; - extra_ = ""; - title_ = ""; - format_ = ""; - timestamp_ = 0L; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private Model(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - mid_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - action_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - content_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - sender_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - receiver_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - extra_ = s; - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - title_ = s; - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - format_ = s; - break; - } - case 72: { - - timestamp_ = input.readInt64(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable - .ensureFieldAccessorsInitialized(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); - } - - public static final int MID_FIELD_NUMBER = 1; - private volatile java.lang.Object mid_; - - /** - * string mid = 1; - */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } - } - - /** - * string mid = 1; - */ - public com.google.protobuf.ByteString getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ACTION_FIELD_NUMBER = 2; - private volatile java.lang.Object action_; - - /** - * string action = 2; - */ - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } - } - - /** - * string action = 2; - */ - public com.google.protobuf.ByteString getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONTENT_FIELD_NUMBER = 3; - private volatile java.lang.Object content_; - - /** - * string content = 3; - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } - } - - /** - * string content = 3; - */ - public com.google.protobuf.ByteString getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SENDER_FIELD_NUMBER = 4; - private volatile java.lang.Object sender_; - - /** - * string sender = 4; - */ - public java.lang.String getSender() { - java.lang.Object ref = sender_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sender_ = s; - return s; - } - } - - /** - * string sender = 4; - */ - public com.google.protobuf.ByteString getSenderBytes() { - java.lang.Object ref = sender_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - sender_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RECEIVER_FIELD_NUMBER = 5; - private volatile java.lang.Object receiver_; - - /** - * string receiver = 5; - */ - public java.lang.String getReceiver() { - java.lang.Object ref = receiver_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - receiver_ = s; - return s; - } - } - - /** - * string receiver = 5; - */ - public com.google.protobuf.ByteString getReceiverBytes() { - java.lang.Object ref = receiver_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - receiver_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EXTRA_FIELD_NUMBER = 6; - private volatile java.lang.Object extra_; - - /** - * string extra = 6; - */ - public java.lang.String getExtra() { - java.lang.Object ref = extra_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - extra_ = s; - return s; - } - } - - /** - * string extra = 6; - */ - public com.google.protobuf.ByteString getExtraBytes() { - java.lang.Object ref = extra_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - extra_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TITLE_FIELD_NUMBER = 7; - private volatile java.lang.Object title_; - - /** - * string title = 7; - */ - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; - } - } - - /** - * string title = 7; - */ - public com.google.protobuf.ByteString getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FORMAT_FIELD_NUMBER = 8; - private volatile java.lang.Object format_; - - /** - * string format = 8; - */ - public java.lang.String getFormat() { - java.lang.Object ref = format_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - format_ = s; - return s; - } - } - - /** - * string format = 8; - */ - public com.google.protobuf.ByteString getFormatBytes() { - java.lang.Object ref = format_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - format_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMP_FIELD_NUMBER = 9; - private long timestamp_; - - /** - * int64 timestamp = 9; - */ - public long getTimestamp() { - return timestamp_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) - return true; - if (isInitialized == 0) - return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getMidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); - } - if (!getActionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); - } - if (!getContentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); - } - if (!getSenderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); - } - if (!getReceiverBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); - } - if (!getExtraBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); - } - if (!getTitleBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); - } - if (!getFormatBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); - } - if (timestamp_ != 0L) { - output.writeInt64(9, timestamp_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) - return size; - - size = 0; - if (!getMidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); - } - if (!getActionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); - } - if (!getContentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); - } - if (!getSenderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); - } - if (!getReceiverBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); - } - if (!getExtraBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); - } - if (!getTitleBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); - } - if (!getFormatBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); - } - if (timestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, timestamp_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model)) { - return super.equals(obj); - } - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) obj; - - boolean result = true; - result = result && getMid().equals(other.getMid()); - result = result && getAction().equals(other.getAction()); - result = result && getContent().equals(other.getContent()); - result = result && getSender().equals(other.getSender()); - result = result && getReceiver().equals(other.getReceiver()); - result = result && getExtra().equals(other.getExtra()); - result = result && getTitle().equals(other.getTitle()); - result = result && getFormat().equals(other.getFormat()); - result = result && (getTimestamp() == other.getTimestamp()); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + MID_FIELD_NUMBER; - hash = (53 * hash) + getMid().hashCode(); - hash = (37 * hash) + ACTION_FIELD_NUMBER; - hash = (53 * hash) + getAction().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - hash = (37 * hash) + SENDER_FIELD_NUMBER; - hash = (53 * hash) + getSender().hashCode(); - hash = (37 * hash) + RECEIVER_FIELD_NUMBER; - hash = (53 * hash) + getReceiver().hashCode(); - hash = (37 * hash) + EXTRA_FIELD_NUMBER; - hash = (53 * hash) + getExtra().hashCode(); - hash = (37 * hash) + TITLE_FIELD_NUMBER; - hash = (53 * hash) + getTitle().hashCode(); - hash = (37 * hash) + FORMAT_FIELD_NUMBER; - hash = (53 * hash) + getFormat().hashCode(); - hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTimestamp()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, - extensionRegistry); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.server.model.proto.Model) - com.farsunset.cim.sdk.server.model.proto.MessageProto.ModelOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); - } - - // Construct using - // com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - } - } - - public Builder clear() { - super.clear(); - mid_ = ""; - - action_ = ""; - - content_ = ""; - - sender_ = ""; - - receiver_ = ""; - - extra_ = ""; - - title_ = ""; - - format_ = ""; - - timestamp_ = 0L; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; - } - - public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance(); - } - - public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model build() { - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model buildPartial() { - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model( - this); - result.mid_ = mid_; - result.action_ = action_; - result.content_ = content_; - result.sender_ = sender_; - result.receiver_ = receiver_; - result.extra_ = extra_; - result.title_ = title_; - result.format_ = format_; - result.timestamp_ = timestamp_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, - Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) { - return mergeFrom((com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other) { - if (other == com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance()) - return this; - if (!other.getMid().isEmpty()) { - mid_ = other.mid_; - onChanged(); - } - if (!other.getAction().isEmpty()) { - action_ = other.action_; - onChanged(); - } - if (!other.getContent().isEmpty()) { - content_ = other.content_; - onChanged(); - } - if (!other.getSender().isEmpty()) { - sender_ = other.sender_; - onChanged(); - } - if (!other.getReceiver().isEmpty()) { - receiver_ = other.receiver_; - onChanged(); - } - if (!other.getExtra().isEmpty()) { - extra_ = other.extra_; - onChanged(); - } - if (!other.getTitle().isEmpty()) { - title_ = other.title_; - onChanged(); - } - if (!other.getFormat().isEmpty()) { - format_ = other.format_; - onChanged(); - } - if (other.getTimestamp() != 0L) { - setTimestamp(other.getTimestamp()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) e - .getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object mid_ = ""; - - /** - * string mid = 1; - */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string mid = 1; - */ - public com.google.protobuf.ByteString getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string mid = 1; - */ - public Builder setMid(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - mid_ = value; - onChanged(); - return this; - } - - /** - * string mid = 1; - */ - public Builder clearMid() { - - mid_ = getDefaultInstance().getMid(); - onChanged(); - return this; - } - - /** - * string mid = 1; - */ - public Builder setMidBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - mid_ = value; - onChanged(); - return this; - } - - private java.lang.Object action_ = ""; - - /** - * string action = 2; - */ - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string action = 2; - */ - public com.google.protobuf.ByteString getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string action = 2; - */ - public Builder setAction(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - action_ = value; - onChanged(); - return this; - } - - /** - * string action = 2; - */ - public Builder clearAction() { - - action_ = getDefaultInstance().getAction(); - onChanged(); - return this; - } - - /** - * string action = 2; - */ - public Builder setActionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - action_ = value; - onChanged(); - return this; - } - - private java.lang.Object content_ = ""; - - /** - * string content = 3; - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string content = 3; - */ - public com.google.protobuf.ByteString getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string content = 3; - */ - public Builder setContent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - - /** - * string content = 3; - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - onChanged(); - return this; - } - - /** - * string content = 3; - */ - public Builder setContentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - content_ = value; - onChanged(); - return this; - } - - private java.lang.Object sender_ = ""; - - /** - * string sender = 4; - */ - public java.lang.String getSender() { - java.lang.Object ref = sender_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sender_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string sender = 4; - */ - public com.google.protobuf.ByteString getSenderBytes() { - java.lang.Object ref = sender_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - sender_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string sender = 4; - */ - public Builder setSender(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - sender_ = value; - onChanged(); - return this; - } - - /** - * string sender = 4; - */ - public Builder clearSender() { - - sender_ = getDefaultInstance().getSender(); - onChanged(); - return this; - } - - /** - * string sender = 4; - */ - public Builder setSenderBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - sender_ = value; - onChanged(); - return this; - } - - private java.lang.Object receiver_ = ""; - - /** - * string receiver = 5; - */ - public java.lang.String getReceiver() { - java.lang.Object ref = receiver_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - receiver_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string receiver = 5; - */ - public com.google.protobuf.ByteString getReceiverBytes() { - java.lang.Object ref = receiver_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - receiver_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string receiver = 5; - */ - public Builder setReceiver(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - receiver_ = value; - onChanged(); - return this; - } - - /** - * string receiver = 5; - */ - public Builder clearReceiver() { - - receiver_ = getDefaultInstance().getReceiver(); - onChanged(); - return this; - } - - /** - * string receiver = 5; - */ - public Builder setReceiverBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - receiver_ = value; - onChanged(); - return this; - } - - private java.lang.Object extra_ = ""; - - /** - * string extra = 6; - */ - public java.lang.String getExtra() { - java.lang.Object ref = extra_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - extra_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string extra = 6; - */ - public com.google.protobuf.ByteString getExtraBytes() { - java.lang.Object ref = extra_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - extra_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string extra = 6; - */ - public Builder setExtra(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - extra_ = value; - onChanged(); - return this; - } - - /** - * string extra = 6; - */ - public Builder clearExtra() { - - extra_ = getDefaultInstance().getExtra(); - onChanged(); - return this; - } - - /** - * string extra = 6; - */ - public Builder setExtraBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - extra_ = value; - onChanged(); - return this; - } - - private java.lang.Object title_ = ""; - - /** - * string title = 7; - */ - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string title = 7; - */ - public com.google.protobuf.ByteString getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string title = 7; - */ - public Builder setTitle(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - title_ = value; - onChanged(); - return this; - } - - /** - * string title = 7; - */ - public Builder clearTitle() { - - title_ = getDefaultInstance().getTitle(); - onChanged(); - return this; - } - - /** - * string title = 7; - */ - public Builder setTitleBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - title_ = value; - onChanged(); - return this; - } - - private java.lang.Object format_ = ""; - - /** - * string format = 8; - */ - public java.lang.String getFormat() { - java.lang.Object ref = format_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - format_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string format = 8; - */ - public com.google.protobuf.ByteString getFormatBytes() { - java.lang.Object ref = format_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - format_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string format = 8; - */ - public Builder setFormat(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - format_ = value; - onChanged(); - return this; - } - - /** - * string format = 8; - */ - public Builder clearFormat() { - - format_ = getDefaultInstance().getFormat(); - onChanged(); - return this; - } - - /** - * string format = 8; - */ - public Builder setFormatBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - format_ = value; - onChanged(); - return this; - } - - private long timestamp_; - - /** - * int64 timestamp = 9; - */ - public long getTimestamp() { - return timestamp_; - } - - /** - * int64 timestamp = 9; - */ - public Builder setTimestamp(long value) { - - timestamp_ = value; - onChanged(); - return this; - } - - /** - * int64 timestamp = 9; - */ - public Builder clearTimestamp() { - - timestamp_ = 0L; - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.server.model.proto.Model) - } - - // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.server.model.proto.Model) - private static final com.farsunset.cim.sdk.server.model.proto.MessageProto.Model DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model(); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - public Model parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Model(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - static { - java.lang.String[] descriptorData = { "\n\rMessage.proto\022(com.farsunset.cim.sdk.s" - + "erver.model.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(\t" - + "\022\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sen" - + "der\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001" - + "(\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttim" - + "estamp\030\t \001(\003B\016B\014MessageProtob\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); - internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor = getDescriptor().getMessageTypes() - .get(0); - internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor, new java.lang.String[] { - "Mid", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); - } - - // @@protoc_insertion_point(outer_class_scope) + private MessageProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.server.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 id = 1; + */ + long getId(); + + /** + * string action = 2; + */ + java.lang.String getAction(); + /** + * string action = 2; + */ + com.google.protobuf.ByteString + getActionBytes(); + + /** + * string content = 3; + */ + java.lang.String getContent(); + /** + * string content = 3; + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * string sender = 4; + */ + java.lang.String getSender(); + /** + * string sender = 4; + */ + com.google.protobuf.ByteString + getSenderBytes(); + + /** + * string receiver = 5; + */ + java.lang.String getReceiver(); + /** + * string receiver = 5; + */ + com.google.protobuf.ByteString + getReceiverBytes(); + + /** + * string extra = 6; + */ + java.lang.String getExtra(); + /** + * string extra = 6; + */ + com.google.protobuf.ByteString + getExtraBytes(); + + /** + * string title = 7; + */ + java.lang.String getTitle(); + /** + * string title = 7; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string format = 8; + */ + java.lang.String getFormat(); + /** + * string format = 8; + */ + com.google.protobuf.ByteString + getFormatBytes(); + + /** + * int64 timestamp = 9; + */ + long getTimestamp(); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.server.model.proto.Model) + ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + action_ = ""; + content_ = ""; + sender_ = ""; + receiver_ = ""; + extra_ = ""; + title_ = ""; + format_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + id_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + sender_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + receiver_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + extra_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 72: { + + timestamp_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + * int64 id = 1; + */ + public long getId() { + return id_; + } + + public static final int ACTION_FIELD_NUMBER = 2; + private volatile java.lang.Object action_; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private volatile java.lang.Object content_; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SENDER_FIELD_NUMBER = 4; + private volatile java.lang.Object sender_; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECEIVER_FIELD_NUMBER = 5; + private volatile java.lang.Object receiver_; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTRA_FIELD_NUMBER = 6; + private volatile java.lang.Object extra_; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 7; + private volatile java.lang.Object title_; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 8; + private volatile java.lang.Object format_; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private long timestamp_; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (!getSenderBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); + } + if (!getFormatBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); + } + if (timestamp_ != 0L) { + output.writeInt64(9, timestamp_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (!getSenderBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); + } + if (!getFormatBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, timestamp_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) obj; + + if (getId() + != other.getId()) return false; + if (!getAction() + .equals(other.getAction())) return false; + if (!getContent() + .equals(other.getContent())) return false; + if (!getSender() + .equals(other.getSender())) return false; + if (!getReceiver() + .equals(other.getReceiver())) return false; + if (!getExtra() + .equals(other.getExtra())) return false; + if (!getTitle() + .equals(other.getTitle())) return false; + if (!getFormat() + .equals(other.getFormat())) return false; + if (getTimestamp() + != other.getTimestamp()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SENDER_FIELD_NUMBER; + hash = (53 * hash) + getSender().hashCode(); + hash = (37 * hash) + RECEIVER_FIELD_NUMBER; + hash = (53 * hash) + getReceiver().hashCode(); + hash = (37 * hash) + EXTRA_FIELD_NUMBER; + hash = (53 * hash) + getExtra().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.server.model.proto.Model) + com.farsunset.cim.sdk.server.model.proto.MessageProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = 0L; + + action_ = ""; + + content_ = ""; + + sender_ = ""; + + receiver_ = ""; + + extra_ = ""; + + title_ = ""; + + format_ = ""; + + timestamp_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @java.lang.Override + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance(); + } + + @java.lang.Override + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model build() { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model buildPartial() { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model(this); + result.id_ = id_; + result.action_ = action_; + result.content_ = content_; + result.sender_ = sender_; + result.receiver_ = receiver_; + result.extra_ = extra_; + result.title_ = title_; + result.format_ = format_; + result.timestamp_ = timestamp_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.server.model.proto.MessageProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other) { + if (other == com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getSender().isEmpty()) { + sender_ = other.sender_; + onChanged(); + } + if (!other.getReceiver().isEmpty()) { + receiver_ = other.receiver_; + onChanged(); + } + if (!other.getExtra().isEmpty()) { + extra_ = other.extra_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long id_ ; + /** + * int64 id = 1; + */ + public long getId() { + return id_; + } + /** + * int64 id = 1; + */ + public Builder setId(long value) { + + id_ = value; + onChanged(); + return this; + } + /** + * int64 id = 1; + */ + public Builder clearId() { + + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string action = 2; + */ + public Builder setAction( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder setActionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object sender_ = ""; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sender = 4; + */ + public Builder setSender( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sender_ = value; + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder clearSender() { + + sender_ = getDefaultInstance().getSender(); + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder setSenderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sender_ = value; + onChanged(); + return this; + } + + private java.lang.Object receiver_ = ""; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string receiver = 5; + */ + public Builder setReceiver( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + receiver_ = value; + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder clearReceiver() { + + receiver_ = getDefaultInstance().getReceiver(); + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder setReceiverBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + receiver_ = value; + onChanged(); + return this; + } + + private java.lang.Object extra_ = ""; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string extra = 6; + */ + public Builder setExtra( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + extra_ = value; + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder clearExtra() { + + extra_ = getDefaultInstance().getExtra(); + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder setExtraBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + extra_ = value; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 7; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object format_ = ""; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string format = 8; + */ + public Builder setFormat( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder setFormatBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 9; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 9; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.server.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.server.model.proto.Model) + private static final com.farsunset.cim.sdk.server.model.proto.MessageProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model(); + } + + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rMessage.proto\022(com.farsunset.cim.sdk.s" + + "erver.model.proto\"\227\001\n\005Model\022\n\n\002id\030\001 \001(\003\022" + + "\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006send" + + "er\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001(" + + "\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttime" + + "stamp\030\t \001(\003B\016B\014MessageProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor, + new java.lang.String[] { "Id", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java index 9b49855..ebd3cde 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java @@ -57,7 +57,8 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver { /* * 设备网络状态变化事件 */ - if (intent.getAction().equals(CIMConstant.IntentAction.ACTION_NETWORK_CHANGED)) { + if (intent.getAction().equals(CIMConstant.IntentAction.ACTION_NETWORK_CHANGED) + ||intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) { ConnectivityManager connectivityManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); onDevicesNetworkChanged(connectivityManager.getActiveNetworkInfo()); diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java index fbc9838..0804ee3 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java @@ -27,6 +27,8 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.net.ConnectivityManager; +import android.net.Network; import android.os.Build; import android.os.Handler; import android.os.IBinder; @@ -34,6 +36,7 @@ import android.os.Message; import java.util.concurrent.Semaphore; +import com.farsunset.cim.sdk.android.constant.CIMConstant; import com.farsunset.cim.sdk.android.filter.CIMLoggingHandler; import com.farsunset.cim.sdk.android.model.SentBody; @@ -58,6 +61,30 @@ public class CIMPushService extends Service { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ keepAliveReceiver = new KeepAliveBroadcastReceiver(); registerReceiver(keepAliveReceiver, keepAliveReceiver.getIntentFilter()); + + } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + + ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); + connectivityManager.registerDefaultNetworkCallback(new ConnectivityManager.NetworkCallback() { + @Override + public void onAvailable(Network network) { + Intent intent = new Intent(); + intent.setPackage(getPackageName()); + intent.setAction(CIMConstant.IntentAction.ACTION_NETWORK_CHANGED); + sendBroadcast(intent); + } + @Override + public void onUnavailable() { + Intent intent = new Intent(); + intent.setPackage(getPackageName()); + intent.setAction(CIMConstant.IntentAction.ACTION_NETWORK_CHANGED); + sendBroadcast(intent); + } + + }); + } } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java index a503fde..fa3afc1 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java @@ -96,7 +96,8 @@ public interface CIMConstant { String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; // 网络变化广播 - String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; + String ACTION_NETWORK_CHANGED = "com.farsunset.cim.NETWORK_CHANAGED"; + // 重试连接 String ACTION_CONNECTION_RECOVERY = "com.farsunset.cim.CONNECTION_RECOVERY"; diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java index c53ab1e..eea4b95 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java @@ -99,7 +99,7 @@ public class ClientMessageDecoder extends ByteToMessageDecoder { if (CIMConstant.ProtobufType.MESSAGE == type) { MessageProto.Model bodyProto = MessageProto.Model.parseFrom(bytes); Message message = new Message(); - message.setMid(bodyProto.getMid()); + message.setId(bodyProto.getId()); message.setAction(bodyProto.getAction()); message.setContent(bodyProto.getContent()); message.setSender(bodyProto.getSender()); diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java index d0185c5..fcbca5f 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java @@ -33,7 +33,7 @@ public class Message implements Serializable { /** * 消息类型,用户自定义消息类别 */ - private String mid; + private long id; /** * 消息类型,用户自定义消息类别 @@ -141,7 +141,7 @@ public class Message implements Serializable { StringBuffer buffer = new StringBuffer(); buffer.append("#Message#").append("\n"); - buffer.append("mid:").append(mid).append("\n"); + buffer.append("id:").append(id).append("\n"); buffer.append("action:").append(action).append("\n"); buffer.append("title:").append(title).append("\n"); buffer.append("content:").append(content).append("\n"); @@ -152,13 +152,14 @@ public class Message implements Serializable { buffer.append("timestamp:").append(timestamp); return buffer.toString(); } - - public String getMid() { - return mid; + + + public long getId() { + return id; } - public void setMid(String mid) { - this.mid = mid; + public void setId(long id) { + this.id = id; } public boolean isNotEmpty(String txt) { diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto index a5cb5ee..aee4268 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package com.farsunset.cim.sdk.android.model.proto; option java_outer_classname="MessageProto"; message Model { - string mid = 1; + int64 id = 1; string action = 2; string content = 3; string sender = 4; diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java index 74c02e5..9f00868 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java @@ -19,14 +19,9 @@ public final class MessageProto { com.google.protobuf.MessageOrBuilder { /** - * string mid = 1; + * int64 id = 1; */ - java.lang.String getMid(); - /** - * string mid = 1; - */ - com.google.protobuf.ByteString - getMidBytes(); + long getId(); /** * string action = 2; @@ -116,7 +111,6 @@ public final class MessageProto { super(builder); } private Model() { - mid_ = ""; action_ = ""; content_ = ""; sender_ = ""; @@ -150,10 +144,9 @@ public final class MessageProto { case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); + case 8: { - mid_ = s; + id_ = input.readInt64(); break; } case 18: { @@ -235,38 +228,13 @@ public final class MessageProto { com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.Builder.class); } - public static final int MID_FIELD_NUMBER = 1; - private volatile java.lang.Object mid_; + public static final int ID_FIELD_NUMBER = 1; + private long id_; /** - * string mid = 1; + * int64 id = 1; */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } - } - /** - * string mid = 1; - */ - public com.google.protobuf.ByteString - getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public long getId() { + return id_; } public static final int ACTION_FIELD_NUMBER = 2; @@ -530,8 +498,8 @@ public final class MessageProto { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getMidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); + if (id_ != 0L) { + output.writeInt64(1, id_); } if (!getActionBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); @@ -566,8 +534,9 @@ public final class MessageProto { if (size != -1) return size; size = 0; - if (!getMidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); } if (!getActionBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); @@ -609,8 +578,8 @@ public final class MessageProto { } com.farsunset.cim.sdk.android.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.android.model.proto.MessageProto.Model) obj; - if (!getMid() - .equals(other.getMid())) return false; + if (getId() + != other.getId()) return false; if (!getAction() .equals(other.getAction())) return false; if (!getContent() @@ -638,8 +607,9 @@ public final class MessageProto { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + MID_FIELD_NUMBER; - hash = (53 * hash) + getMid().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); hash = (37 * hash) + ACTION_FIELD_NUMBER; hash = (53 * hash) + getAction().hashCode(); hash = (37 * hash) + CONTENT_FIELD_NUMBER; @@ -790,7 +760,7 @@ public final class MessageProto { @java.lang.Override public Builder clear() { super.clear(); - mid_ = ""; + id_ = 0L; action_ = ""; @@ -834,7 +804,7 @@ public final class MessageProto { @java.lang.Override public com.farsunset.cim.sdk.android.model.proto.MessageProto.Model buildPartial() { com.farsunset.cim.sdk.android.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.android.model.proto.MessageProto.Model(this); - result.mid_ = mid_; + result.id_ = id_; result.action_ = action_; result.content_ = content_; result.sender_ = sender_; @@ -891,9 +861,8 @@ public final class MessageProto { public Builder mergeFrom(com.farsunset.cim.sdk.android.model.proto.MessageProto.Model other) { if (other == com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.getDefaultInstance()) return this; - if (!other.getMid().isEmpty()) { - mid_ = other.mid_; - onChanged(); + if (other.getId() != 0L) { + setId(other.getId()); } if (!other.getAction().isEmpty()) { action_ = other.action_; @@ -955,71 +924,28 @@ public final class MessageProto { return this; } - private java.lang.Object mid_ = ""; + private long id_ ; /** - * string mid = 1; + * int64 id = 1; */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } else { - return (java.lang.String) ref; - } + public long getId() { + return id_; } /** - * string mid = 1; + * int64 id = 1; */ - public com.google.protobuf.ByteString - getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string mid = 1; - */ - public Builder setMid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - mid_ = value; + public Builder setId(long value) { + + id_ = value; onChanged(); return this; } /** - * string mid = 1; + * int64 id = 1; */ - public Builder clearMid() { + public Builder clearId() { - mid_ = getDefaultInstance().getMid(); - onChanged(); - return this; - } - /** - * string mid = 1; - */ - public Builder setMidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - mid_ = value; + id_ = 0L; onChanged(); return this; } @@ -1600,11 +1526,11 @@ public final class MessageProto { static { java.lang.String[] descriptorData = { "\n\rMessage.proto\022)com.farsunset.cim.sdk.a" + - "ndroid.model.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(" + - "\t\022\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006se" + - "nder\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 " + - "\001(\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\tti" + - "mestamp\030\t \001(\003B\016B\014MessageProtob\006proto3" + "ndroid.model.proto\"\227\001\n\005Model\022\n\n\002id\030\001 \001(\003" + + "\022\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sen" + + "der\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001" + + "(\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttim" + + "estamp\030\t \001(\003B\016B\014MessageProtob\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -1623,7 +1549,7 @@ public final class MessageProto { internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor, - new java.lang.String[] { "Mid", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + new java.lang.String[] { "Id", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/cim_for_netty/cim-boot-server/build.gradle b/cim_for_netty/cim-boot-server/build.gradle index 7573fc3..9589635 100644 --- a/cim_for_netty/cim-boot-server/build.gradle +++ b/cim_for_netty/cim-boot-server/build.gradle @@ -32,12 +32,12 @@ dependencies { compile 'com.squareup.okhttp3:okhttp:3.10.0' compile 'cn.teaey.apns4j:apns4j:1.1.4' - compile 'io.netty:netty-handler:4.1.34.Final' - compile 'io.netty:netty-buffer:4.1.34.Final' - compile 'io.netty:netty-codec:4.1.34.Final' - compile 'io.netty:netty-codec-http:4.1.34.Final' - compile 'io.netty:netty-common:4.1.34.Final' - compile 'io.netty:netty-transport:4.1.34.Final' + compile 'io.netty:netty-handler:4.1.35.Final' + compile 'io.netty:netty-buffer:4.1.35.Final' + compile 'io.netty:netty-codec:4.1.35.Final' + compile 'io.netty:netty-codec-http:4.1.35.Final' + compile 'io.netty:netty-common:4.1.35.Final' + compile 'io.netty:netty-transport:4.1.35.Final' diff --git a/cim_for_netty/cim-boot-server/libs/cim-android-sdk-3.5.1.jar b/cim_for_netty/cim-boot-server/libs/cim-android-sdk-3.5.1.jar deleted file mode 100644 index 6fb6765..0000000 Binary files a/cim_for_netty/cim-boot-server/libs/cim-android-sdk-3.5.1.jar and /dev/null differ diff --git a/cim_for_netty/cim-boot-server/libs/cim-android-sdk-3.6.jar b/cim_for_netty/cim-boot-server/libs/cim-android-sdk-3.6.jar new file mode 100644 index 0000000..525cec3 Binary files /dev/null and b/cim_for_netty/cim-boot-server/libs/cim-android-sdk-3.6.jar differ diff --git a/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/MessageController.java b/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/MessageController.java index d2e5444..4dc1f15 100644 --- a/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/MessageController.java +++ b/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/MessageController.java @@ -65,13 +65,13 @@ public class MessageController { MessageResult result = new MessageResult(); - message.setMid(StringUtil.getUUID()); + message.setId(System.currentTimeMillis()); if (Constants.MessageType.TYPE_2.equals(message.getAction())) { systemMessagePusher.push(message); } else { defaultMessagePusher.push(message); } - result.id = message.getMid(); + result.id = message.getId(); result.timestamp = message.getTimestamp(); return result; } diff --git a/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/dto/MessageResult.java b/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/dto/MessageResult.java index 3ce24d7..3e84d51 100644 --- a/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/dto/MessageResult.java +++ b/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/api/controller/dto/MessageResult.java @@ -23,5 +23,5 @@ package com.farsunset.cim.api.controller.dto; public class MessageResult extends BaseResult { public long timestamp; - public String id; + public long id; } diff --git a/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/handler/BindHandler.java b/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/handler/BindHandler.java index 270b371..a789322 100644 --- a/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/handler/BindHandler.java +++ b/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/handler/BindHandler.java @@ -125,7 +125,7 @@ public class BindHandler implements CIMRequestHandler { msg.setReceiver(account); msg.setSender("system"); msg.setContent(deviceModel); - msg.setMid(StringUtil.getUUID()); + msg.setId(System.currentTimeMillis()); closeQuietly(oldSession,msg); } diff --git a/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/service/impl/MessageDispatcherImpl.java b/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/service/impl/MessageDispatcherImpl.java index 6da069f..3f7ab3c 100644 --- a/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/service/impl/MessageDispatcherImpl.java +++ b/cim_for_netty/cim-boot-server/src/main/java/com/farsunset/cim/service/impl/MessageDispatcherImpl.java @@ -62,7 +62,7 @@ public class MessageDispatcherImpl implements MessageDispatcher{ OkHttpClient httpclient = new OkHttpClient.Builder().connectTimeout(10, TimeUnit.SECONDS).build(); FormBody.Builder build = new FormBody.Builder(); - build.add("mid", String.valueOf(msg.getMid())); + build.add("id", String.valueOf(msg.getId())); build.add("action", msg.getAction()); build.add("title", msg.getTitle()); build.add("content", msg.getContent()); diff --git a/cim_for_netty/cim-boot-server/src/main/resources/static/js/cim/message.js b/cim_for_netty/cim-boot-server/src/main/resources/static/js/cim/message.js index 644e760..30b942a 100644 --- a/cim_for_netty/cim-boot-server/src/main/resources/static/js/cim/message.js +++ b/cim_for_netty/cim-boot-server/src/main/resources/static/js/cim/message.js @@ -13,7 +13,6 @@ var goog = jspb; var global = Function('return this')(); goog.exportSymbol('proto.com.farsunset.cim.sdk.web.model.Message', null, global); - /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -29,10 +28,15 @@ proto.com.farsunset.cim.sdk.web.model.Message = function(opt_data) { }; goog.inherits(proto.com.farsunset.cim.sdk.web.model.Message, jspb.Message); if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ proto.com.farsunset.cim.sdk.web.model.Message.displayName = 'proto.com.farsunset.cim.sdk.web.model.Message'; } + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. @@ -59,8 +63,8 @@ proto.com.farsunset.cim.sdk.web.model.Message.prototype.toObject = function(opt_ * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.com.farsunset.cim.sdk.web.model.Message.toObject = function(includeInstance, msg) { - var f, obj = { - mid: jspb.Message.getFieldWithDefault(msg, 1, ""), + var obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, 0), action: jspb.Message.getFieldWithDefault(msg, 2, ""), content: jspb.Message.getFieldWithDefault(msg, 3, ""), sender: jspb.Message.getFieldWithDefault(msg, 4, ""), @@ -106,8 +110,8 @@ proto.com.farsunset.cim.sdk.web.model.Message.deserializeBinaryFromReader = func var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setMid(value); + var value = /** @type {number} */ (reader.readInt64()); + msg.setId(value); break; case 2: var value = /** @type {string} */ (reader.readString()); @@ -170,9 +174,9 @@ proto.com.farsunset.cim.sdk.web.model.Message.prototype.serializeBinary = functi */ proto.com.farsunset.cim.sdk.web.model.Message.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getMid(); - if (f.length > 0) { - writer.writeString( + f = message.getId(); + if (f !== 0) { + writer.writeInt64( 1, f ); @@ -237,17 +241,17 @@ proto.com.farsunset.cim.sdk.web.model.Message.serializeBinaryToWriter = function /** - * optional string mid = 1; - * @return {string} + * optional int64 id = 1; + * @return {number} */ -proto.com.farsunset.cim.sdk.web.model.Message.prototype.getMid = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.com.farsunset.cim.sdk.web.model.Message.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; -/** @param {string} value */ -proto.com.farsunset.cim.sdk.web.model.Message.prototype.setMid = function(value) { - jspb.Message.setProto3StringField(this, 1, value); +/** @param {number} value */ +proto.com.farsunset.cim.sdk.web.model.Message.prototype.setId = function(value) { + jspb.Message.setProto3IntField(this, 1, value); }; @@ -374,12 +378,12 @@ proto.com.farsunset.cim.sdk.web.model.Message.prototype.setTimestamp = function( goog.object.extend(exports, proto.com.farsunset.cim.sdk.web.model); },{"google-protobuf":3}],2:[function(require,module,exports){ -var messageProtobuf= require('./MessageProtobuf'); +var myProto = require('./Message_pb'); module.exports = { - DataProto: messageProtobuf + DataProto: myProto } -},{"./MessageProtobuf":1}],3:[function(require,module,exports){ +},{"./Message_pb":1}],3:[function(require,module,exports){ (function (global,Buffer){ var $jscomp={scope:{},getGlobal:function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global?global:a}};$jscomp.global=$jscomp.getGlobal(this);$jscomp.initSymbol=function(){$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol);$jscomp.initSymbol=function(){}};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(a){return"jscomp_symbol_"+a+$jscomp.symbolCounter_++}; $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();$jscomp.global.Symbol.iterator||($jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));$jscomp.initSymbolIterator=function(){}};$jscomp.makeIterator=function(a){$jscomp.initSymbolIterator();$jscomp.initSymbol();$jscomp.initSymbolIterator();var b=a[Symbol.iterator];if(b)return b.call(a);var c=0;return{next:function(){return c=a||"\u0080"<=a&&"\ufffd">=a};goog.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};goog.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")}; @@ -485,16 +492,7 @@ goog.asserts.assertString=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isS goog.asserts.assertObject=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isObject(a)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertArray=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isArray(a)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a}; goog.asserts.assertBoolean=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(a)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertElement=function(a,b,c){!goog.asserts.ENABLE_ASSERTS||goog.isObject(a)&&a.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a}; goog.asserts.assertInstanceof=function(a,b,c,d){!goog.asserts.ENABLE_ASSERTS||a instanceof b||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(b),goog.asserts.getType_(a)],c,Array.prototype.slice.call(arguments,3));return a};goog.asserts.assertObjectPrototypeIsIntact=function(){for(var a in Object.prototype)goog.asserts.fail(a+" should not be enumerable in Object.prototype.")}; -goog.asserts.getType_=function(a){return a instanceof Function?a.displayName||a.name||"unknown type name":a instanceof Object?a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a):null===a?"null":typeof a};var jspb={Map:function(a,b){this.arr_=a;this.valueCtor_=b;this.map_={};this.arrClean=!0;0c?Math.max(0,a.length+c):c;if(goog.isString(a))return goog.isString(b)&&1==b.length?a.indexOf(b,c):-1;for(;cc&&(c=Math.max(0,a.length+c));if(goog.isString(a))return goog.isString(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in a&&a[c]===b)return c;return-1}; goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(a,b,c){goog.asserts.assert(null!=a.length);Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f>4);64!=g&&(b(f<<4&240|g>>2),64!=h&&b(g<<6&192|h))}}; goog.crypt.base64.init_=function(){if(!goog.crypt.base64.byteToCharMap_){goog.crypt.base64.byteToCharMap_={};goog.crypt.base64.charToByteMap_={};goog.crypt.base64.byteToCharMapWebSafe_={};for(var a=0;a=goog.crypt.base64.ENCODED_VALS_BASE.length&& -(goog.crypt.base64.charToByteMap_[goog.crypt.base64.ENCODED_VALS_WEBSAFE.charAt(a)]=a)}};jspb.ExtensionFieldInfo=function(a,b,c,d,e){this.fieldIndex=a;this.fieldName=b;this.ctor=c;this.toObjectFn=d;this.isRepeated=e};jspb.ExtensionFieldBinaryInfo=function(a,b,c,d,e,f){this.fieldInfo=a;this.binaryReaderFn=b;this.binaryWriterFn=c;this.binaryMessageSerializeFn=d;this.binaryMessageDeserializeFn=e;this.isPacked=f};jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor};jspb.Message=function(){};jspb.Message.GENERATE_TO_OBJECT=!0;jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE; +(goog.crypt.base64.charToByteMap_[goog.crypt.base64.ENCODED_VALS_WEBSAFE.charAt(a)]=a)}};jspb.utils={};jspb.utils.split64Low=0;jspb.utils.split64High=0;jspb.utils.splitUint64=function(a){var b=a>>>0;a=Math.floor((a-b)/jspb.BinaryConstants.TWO_TO_32)>>>0;jspb.utils.split64Low=b;jspb.utils.split64High=a};jspb.utils.splitInt64=function(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/jspb.BinaryConstants.TWO_TO_32);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295a;a=2*Math.abs(a);jspb.utils.splitUint64(a);a=jspb.utils.split64Low;var c=jspb.utils.split64High;b&&(0==a?0==c?c=a=4294967295:(c--,a=4294967295):a--);jspb.utils.split64Low=a;jspb.utils.split64High=c}; +jspb.utils.splitFloat32=function(a){var b=0>a?1:0;a=b?-a:a;var c;0===a?0<1/a?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648):isNaN(a)?(jspb.utils.split64High=0,jspb.utils.split64Low=2147483647):a>jspb.BinaryConstants.FLOAT32_MAX?(jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|2139095040)>>>0):a>>0):(c=Math.floor(Math.log(a)/ +Math.LN2),a*=Math.pow(2,-c),a=Math.round(a*jspb.BinaryConstants.TWO_TO_23)&8388607,jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|c+127<<23|a)>>>0)}; +jspb.utils.splitFloat64=function(a){var b=0>a?1:0;a=b?-a:a;if(0===a)jspb.utils.split64High=0<1/a?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(a))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(a>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(b<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(a>>0;jspb.utils.split64Low=c>>>0}else{var d= +Math.floor(Math.log(a)/Math.LN2);1024==d&&(d=1023);c=a*Math.pow(2,-d);a=c*jspb.BinaryConstants.TWO_TO_20&1048575;c=c*jspb.BinaryConstants.TWO_TO_52>>>0;jspb.utils.split64High=(b<<31|d+1023<<20|a)>>>0;jspb.utils.split64Low=c}}; +jspb.utils.splitHash64=function(a){var b=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=a.charCodeAt(4),g=a.charCodeAt(5),h=a.charCodeAt(6);a=a.charCodeAt(7);jspb.utils.split64Low=b+(c<<8)+(d<<16)+(e<<24)>>>0;jspb.utils.split64High=f+(g<<8)+(h<<16)+(a<<24)>>>0};jspb.utils.joinUint64=function(a,b){return b*jspb.BinaryConstants.TWO_TO_32+a}; +jspb.utils.joinInt64=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinZigzag64=function(a,b){var c=a&1;a=(a>>>1|b<<31)>>>0;b>>>=1;c&&(a=a+1>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinFloat32=function(a,b){var c=2*(a>>31)+1,d=a>>>23&255,e=a&8388607;return 255==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-149)*e:c*Math.pow(2,d-150)*(e+Math.pow(2,23))}; +jspb.utils.joinFloat64=function(a,b){var c=2*(b>>31)+1,d=b>>>20&2047,e=jspb.BinaryConstants.TWO_TO_32*(b&1048575)+a;return 2047==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-1074)*e:c*Math.pow(2,d-1075)*(e+jspb.BinaryConstants.TWO_TO_52)};jspb.utils.joinHash64=function(a,b){return String.fromCharCode(a>>>0&255,a>>>8&255,a>>>16&255,a>>>24&255,b>>>0&255,b>>>8&255,b>>>16&255,b>>>24&255)};jspb.utils.DIGITS="0123456789abcdef".split(""); +jspb.utils.joinUnsignedDecimalString=function(a,b){function c(a){for(var b=1E7,c=0;7>c;c++){var b=b/10,d=a/b%10>>>0;if(0!=d||h)h=!0,k+=g[d]}}if(2097151>=b)return""+(jspb.BinaryConstants.TWO_TO_32*b+a);var d=(a>>>24|b<<8)>>>0&16777215,e=b>>16&65535,f=(a&16777215)+6777216*d+6710656*e,d=d+8147497*e,e=2*e;1E7<=f&&(d+=Math.floor(f/1E7),f%=1E7);1E7<=d&&(e+=Math.floor(d/1E7),d%=1E7);var g=jspb.utils.DIGITS,h=!1,k="";(e||h)&&c(e);(d||h)&&c(d);(f||h)&&c(f);return k}; +jspb.utils.joinSignedDecimalString=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b+(0==a?1:0)>>>0);var d=jspb.utils.joinUnsignedDecimalString(a,b);return c?"-"+d:d};jspb.utils.hash64ToDecimalString=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinSignedDecimalString(c,d):jspb.utils.joinUnsignedDecimalString(c,d)}; +jspb.utils.hash64ArrayToDecimalStrings=function(a,b){for(var c=Array(a.length),d=0;dc&&(1!==a||0>>8}}function c(){for(var a=0;8>a;a++)e[a]=~e[a]&255}goog.asserts.assert(0c;c++){var d=a.charCodeAt(7-c);b[2*c+2]=jspb.utils.DIGITS[d>>4];b[2*c+3]=jspb.utils.DIGITS[d&15]}return b.join("")};jspb.utils.hexStringToHash64=function(a){a=a.toLowerCase();goog.asserts.assert(18==a.length);goog.asserts.assert("0"==a[0]);goog.asserts.assert("x"==a[1]);for(var b="",c=0;8>c;c++)var d=jspb.utils.DIGITS.indexOf(a[2*c+2]),e=jspb.utils.DIGITS.indexOf(a[2*c+3]),b=String.fromCharCode(16*d+e)+b;return b}; +jspb.utils.hash64ToNumber=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinInt64(c,d):jspb.utils.joinUint64(c,d)};jspb.utils.numberToHash64=function(a){jspb.utils.splitInt64(a);return jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.utils.countVarints=function(a,b,c){for(var d=0,e=b;e>7;return c-b-d}; +jspb.utils.countVarintFields=function(a,b,c,d){var e=0;d=8*d+jspb.BinaryConstants.WireType.VARINT;if(128>d)for(;b>=7}if(a[b++]!=f)break;for(e++;f=a[b++],0!=(f&128););}return e};jspb.utils.countFixedFields_=function(a,b,c,d,e){var f=0;if(128>d)for(;b>=7}if(a[b++]!=g)break;f++;b+=e}return f}; +jspb.utils.countFixed32Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED32,4)};jspb.utils.countFixed64Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED64,8)}; +jspb.utils.countDelimitedFields=function(a,b,c,d){var e=0;for(d=8*d+jspb.BinaryConstants.WireType.DELIMITED;b>=7}if(a[b++]!=f)break;e++;for(var g=0,h=1;f=a[b++],g+=(f&127)*h,h*=128,0!=(f&128););b+=g}return e};jspb.utils.debugBytesToTextFormat=function(a){var b='"';if(a){a=jspb.utils.byteSourceToUint8Array(a);for(var c=0;ca[c]&&(b+="0"),b+=a[c].toString(16)}return b+'"'}; +jspb.utils.debugScalarToTextFormat=function(a){return goog.isString(a)?goog.string.quote(a):a.toString()};jspb.utils.stringToByteArray=function(a){for(var b=new Uint8Array(a.length),c=0;cjspb.BinaryIterator.instanceCache_.length&&jspb.BinaryIterator.instanceCache_.push(this)}; +jspb.BinaryIterator.prototype.clear=function(){this.decoder_&&this.decoder_.free();this.elements_=this.nextMethod_=this.decoder_=null;this.cursor_=0;this.nextValue_=null;this.atEnd_=!0};jspb.BinaryIterator.prototype.get=function(){return this.nextValue_};jspb.BinaryIterator.prototype.atEnd=function(){return this.atEnd_}; +jspb.BinaryIterator.prototype.next=function(){var a=this.nextValue_;this.decoder_?this.decoder_.atEnd()?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.nextMethod_.call(this.decoder_):this.elements_&&(this.cursor_==this.elements_.length?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.elements_[this.cursor_++]);return a};jspb.BinaryDecoder=function(a,b,c){this.bytes_=null;this.tempHigh_=this.tempLow_=this.cursor_=this.end_=this.start_=0;this.error_=!1;a&&this.setBlock(a,b,c)}; +jspb.BinaryDecoder.instanceCache_=[];jspb.BinaryDecoder.alloc=function(a,b,c){if(jspb.BinaryDecoder.instanceCache_.length){var d=jspb.BinaryDecoder.instanceCache_.pop();a&&d.setBlock(a,b,c);return d}return new jspb.BinaryDecoder(a,b,c)};jspb.BinaryDecoder.prototype.free=function(){this.clear();100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)};jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)}; +jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null;this.cursor_=this.end_=this.start_=0;this.error_=!1};jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_};jspb.BinaryDecoder.prototype.setBlock=function(a,b,c){this.bytes_=jspb.utils.byteSourceToUint8Array(a);this.start_=goog.isDef(b)?b:0;this.end_=goog.isDef(c)?this.start_+c:this.bytes_.length;this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_}; +jspb.BinaryDecoder.prototype.setEnd=function(a){this.end_=a};jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_};jspb.BinaryDecoder.prototype.setCursor=function(a){this.cursor_=a};jspb.BinaryDecoder.prototype.advance=function(a){this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_)};jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_}; +jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_};jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_}; +jspb.BinaryDecoder.prototype.readSplitVarint64_=function(){for(var a,b=0,c,d=0;4>d;d++)if(a=this.bytes_[this.cursor_++],b|=(a&127)<<7*d,128>a){this.tempLow_=b>>>0;this.tempHigh_=0;return}a=this.bytes_[this.cursor_++];b|=(a&127)<<28;c=0|(a&127)>>4;if(128>a)this.tempLow_=b>>>0,this.tempHigh_=c>>>0;else{for(d=0;5>d;d++)if(a=this.bytes_[this.cursor_++],c|=(a&127)<<7*d+3,128>a){this.tempLow_=b>>>0;this.tempHigh_=c>>>0;return}goog.asserts.fail("Failed to read varint, encoding is invalid.");this.error_= +!0}};jspb.BinaryDecoder.prototype.skipVarint=function(){for(;this.bytes_[this.cursor_]&128;)this.cursor_++;this.cursor_++};jspb.BinaryDecoder.prototype.unskipVarint=function(a){for(;128>>=7;this.cursor_--}; +jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var a,b=this.bytes_;a=b[this.cursor_+0];var c=a&127;if(128>a)return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+1];c|=(a&127)<<7;if(128>a)return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+2];c|=(a&127)<<14;if(128>a)return this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+3];c|=(a&127)<<21;if(128>a)return this.cursor_+=4,goog.asserts.assert(this.cursor_<= +this.end_),c;a=b[this.cursor_+4];c|=(a&15)<<28;if(128>a)return this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),c>>>0;this.cursor_+=5;128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&goog.asserts.assert(!1);goog.asserts.assert(this.cursor_<=this.end_);return c};jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32;jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()}; +jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()};jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var a=this.readUnsignedVarint32();return a>>>1^-(a&1)};jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinUint64(this.tempLow_,this.tempHigh_)}; +jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinUnsignedDecimalString(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinInt64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinSignedDecimalString(this.tempLow_,this.tempHigh_)}; +jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinZigzag64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readZigzagVarint64().toString()};jspb.BinaryDecoder.prototype.readUint8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a}; +jspb.BinaryDecoder.prototype.readUint16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8};jspb.BinaryDecoder.prototype.readUint32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8|c<<16|d<<24)>>>0}; +jspb.BinaryDecoder.prototype.readUint64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUint64(a,b)};jspb.BinaryDecoder.prototype.readUint64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUnsignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readInt8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a<<24>>24}; +jspb.BinaryDecoder.prototype.readInt16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8)<<16>>16};jspb.BinaryDecoder.prototype.readInt32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8|c<<16|d<<24}; +jspb.BinaryDecoder.prototype.readInt64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinInt64(a,b)};jspb.BinaryDecoder.prototype.readInt64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinSignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readFloat=function(){var a=this.readUint32();return jspb.utils.joinFloat32(a,0)}; +jspb.BinaryDecoder.prototype.readDouble=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinFloat64(a,b)};jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]};jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()}; +jspb.BinaryDecoder.prototype.readString=function(a){var b=this.bytes_,c=this.cursor_;a=c+a;for(var d=[],e="";cf)d.push(f);else if(192>f)continue;else if(224>f){var g=b[c++];d.push((f&31)<<6|g&63)}else if(240>f){var g=b[c++],h=b[c++];d.push((f&15)<<12|(g&63)<<6|h&63)}else if(248>f){var g=b[c++],h=b[c++],k=b[c++],f=(f&7)<<18|(g&63)<<12|(h&63)<<6|k&63,f=f-65536;d.push((f>>10&1023)+55296,(f&1023)+56320)}8192<=d.length&&(e+=String.fromCharCode.apply(null,d),d.length=0)}e+=goog.crypt.byteArrayToString(d); +this.cursor_=c;return e};jspb.BinaryDecoder.prototype.readStringWithLength=function(){var a=this.readUnsignedVarint32();return this.readString(a)};jspb.BinaryDecoder.prototype.readBytes=function(a){if(0>a||this.cursor_+a>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var b=this.bytes_.subarray(this.cursor_,this.cursor_+a);this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_);return b}; +jspb.BinaryDecoder.prototype.readVarintHash64=function(){this.readSplitVarint64_();return jspb.utils.joinHash64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readFixedHash64=function(){var a=this.bytes_,b=this.cursor_,c=a[b+0],d=a[b+1],e=a[b+2],f=a[b+3],g=a[b+4],h=a[b+5],k=a[b+6],a=a[b+7];this.cursor_+=8;return String.fromCharCode(c,d,e,f,g,h,k,a)};jspb.BinaryReader=function(a,b,c){this.decoder_=jspb.BinaryDecoder.alloc(a,b,c);this.fieldCursor_=this.decoder_.getCursor();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null};jspb.BinaryReader.instanceCache_=[]; +jspb.BinaryReader.alloc=function(a,b,c){if(jspb.BinaryReader.instanceCache_.length){var d=jspb.BinaryReader.instanceCache_.pop();a&&d.decoder_.setBlock(a,b,c);return d}return new jspb.BinaryReader(a,b,c)};jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc; +jspb.BinaryReader.prototype.free=function(){this.decoder_.clear();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null;100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)};jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_};jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()}; +jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()};jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_};jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_};jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP};jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()}; +jspb.BinaryReader.prototype.setBlock=function(a,b,c){this.decoder_.setBlock(a,b,c);this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.advance=function(a){this.decoder_.advance(a)}; +jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var a=this.decoder_.readUnsignedVarint32(),b=a>>>3,a=a&7;if(a!=jspb.BinaryConstants.WireType.VARINT&&a!=jspb.BinaryConstants.WireType.FIXED32&&a!=jspb.BinaryConstants.WireType.FIXED64&&a!=jspb.BinaryConstants.WireType.DELIMITED&&a!=jspb.BinaryConstants.WireType.START_GROUP&&a!=jspb.BinaryConstants.WireType.END_GROUP)return goog.asserts.fail("Invalid wire type: %s (at position %s)", +a,this.fieldCursor_),this.error_=!0,!1;this.nextField_=b;this.nextWireType_=a;return!0};jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)};jspb.BinaryReader.prototype.skipMatchingFields=function(){var a=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==a;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()}; +jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()};jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var a=this.decoder_.readUnsignedVarint32();this.decoder_.advance(a)}}; +jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)};jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)}; +jspb.BinaryReader.prototype.skipGroup=function(){var a=this.nextField_;do{if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF");this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=a&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}while(1)}; +jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}}; +jspb.BinaryReader.prototype.registerReadCallback=function(a,b){goog.isNull(this.readCallbacks_)&&(this.readCallbacks_={});goog.asserts.assert(!this.readCallbacks_[a]);this.readCallbacks_[a]=b};jspb.BinaryReader.prototype.runReadCallback=function(a){goog.asserts.assert(!goog.isNull(this.readCallbacks_));a=this.readCallbacks_[a];goog.asserts.assert(a);return a(this)}; +jspb.BinaryReader.prototype.readAny=function(a){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(a);var b=jspb.BinaryConstants.FieldType;switch(a){case b.DOUBLE:return this.readDouble();case b.FLOAT:return this.readFloat();case b.INT64:return this.readInt64();case b.UINT64:return this.readUint64();case b.INT32:return this.readInt32();case b.FIXED64:return this.readFixed64();case b.FIXED32:return this.readFixed32();case b.BOOL:return this.readBool();case b.STRING:return this.readString(); +case b.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case b.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case b.BYTES:return this.readBytes();case b.UINT32:return this.readUint32();case b.ENUM:return this.readEnum();case b.SFIXED32:return this.readSfixed32();case b.SFIXED64:return this.readSfixed64();case b.SINT32:return this.readSint32();case b.SINT64:return this.readSint64();case b.FHASH64:return this.readFixedHash64();case b.VHASH64:return this.readVarintHash64(); +default:goog.asserts.fail("Invalid field type in readAny()")}return 0};jspb.BinaryReader.prototype.readMessage=function(a,b){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var c=this.decoder_.getEnd(),d=this.decoder_.readUnsignedVarint32(),d=this.decoder_.getCursor()+d;this.decoder_.setEnd(d);b(a,this);this.decoder_.setCursor(d);this.decoder_.setEnd(c)}; +jspb.BinaryReader.prototype.readGroup=function(a,b,c){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP);goog.asserts.assert(this.nextField_==a);c(b,this);this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)}; +jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var a=this.decoder_.readUnsignedVarint32(),b=this.decoder_.getCursor(),c=b+a,a=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),b,a);this.decoder_.setCursor(c);return a};jspb.BinaryReader.prototype.readInt32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint32()}; +jspb.BinaryReader.prototype.readInt32String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint32String()};jspb.BinaryReader.prototype.readInt64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64()};jspb.BinaryReader.prototype.readInt64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64String()}; +jspb.BinaryReader.prototype.readUint32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint32()};jspb.BinaryReader.prototype.readUint32String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint32String()};jspb.BinaryReader.prototype.readUint64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint64()}; +jspb.BinaryReader.prototype.readUint64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint64String()};jspb.BinaryReader.prototype.readSint32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint32()};jspb.BinaryReader.prototype.readSint64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint64()}; +jspb.BinaryReader.prototype.readSint64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint64String()};jspb.BinaryReader.prototype.readFixed32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readUint32()};jspb.BinaryReader.prototype.readFixed64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readUint64()}; +jspb.BinaryReader.prototype.readFixed64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readUint64String()};jspb.BinaryReader.prototype.readSfixed32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readInt32()};jspb.BinaryReader.prototype.readSfixed32String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readInt32().toString()}; +jspb.BinaryReader.prototype.readSfixed64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readInt64()};jspb.BinaryReader.prototype.readSfixed64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readInt64String()};jspb.BinaryReader.prototype.readFloat=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readFloat()}; +jspb.BinaryReader.prototype.readDouble=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readDouble()};jspb.BinaryReader.prototype.readBool=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return!!this.decoder_.readUnsignedVarint32()};jspb.BinaryReader.prototype.readEnum=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64()}; +jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var a=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(a)};jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var a=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(a)}; +jspb.BinaryReader.prototype.readVarintHash64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readVarintHash64()};jspb.BinaryReader.prototype.readFixedHash64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readFixedHash64()}; +jspb.BinaryReader.prototype.readPackedField_=function(a){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);for(var b=this.decoder_.readUnsignedVarint32(),b=this.decoder_.getCursor()+b,c=[];this.decoder_.getCursor()=a.cmp(c)&&(b=b.add(d),c=c.sub(a)),a=a.rightShift(),d=d.rightShift();return[b,c]};jspb.arith.UInt64.prototype.toString=function(){for(var a="",b=this;!b.zero();)var b=b.div(10),c=b[0],a=b[1].lo+a,b=c;""==a&&(a="0");return a}; jspb.arith.UInt64.fromString=function(a){for(var b=new jspb.arith.UInt64(0,0),c=new jspb.arith.UInt64(0,0),d=0;da[d]||"9">>0>>>0,((this.hi+a.hi&4294967295)>>>0)+(4294967296<=this.lo+a.lo?1:0)>>>0)};jspb.arith.Int64.prototype.sub=function(a){return new jspb.arith.Int64((this.lo-a.lo&4294967295)>>>0>>>0,((this.hi-a.hi&4294967295)>>>0)-(0>this.lo-a.lo?1:0)>>>0)};jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)}; -jspb.arith.Int64.prototype.toString=function(){var a=0!=(this.hi&2147483648),b=new jspb.arith.UInt64(this.lo,this.hi);a&&(b=(new jspb.arith.UInt64(0,0)).sub(b));return(a?"-":"")+b.toString()};jspb.arith.Int64.fromString=function(a){var b=0>>0;a=Math.floor((a-b)/jspb.BinaryConstants.TWO_TO_32)>>>0;jspb.utils.split64Low=b;jspb.utils.split64High=a};jspb.utils.splitInt64=function(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/jspb.BinaryConstants.TWO_TO_32);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295a;a=2*Math.abs(a);jspb.utils.splitUint64(a);a=jspb.utils.split64Low;var c=jspb.utils.split64High;b&&(0==a?0==c?c=a=4294967295:(c--,a=4294967295):a--);jspb.utils.split64Low=a;jspb.utils.split64High=c}; -jspb.utils.splitFloat32=function(a){var b=0>a?1:0;a=b?-a:a;var c;0===a?0<1/a?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648):isNaN(a)?(jspb.utils.split64High=0,jspb.utils.split64Low=2147483647):a>jspb.BinaryConstants.FLOAT32_MAX?(jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|2139095040)>>>0):a>>0):(c=Math.floor(Math.log(a)/ -Math.LN2),a*=Math.pow(2,-c),a=Math.round(a*jspb.BinaryConstants.TWO_TO_23)&8388607,jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|c+127<<23|a)>>>0)}; -jspb.utils.splitFloat64=function(a){var b=0>a?1:0;a=b?-a:a;if(0===a)jspb.utils.split64High=0<1/a?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(a))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(a>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(b<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(a>>0;jspb.utils.split64Low=c>>>0}else{var d= -Math.floor(Math.log(a)/Math.LN2);1024==d&&(d=1023);c=a*Math.pow(2,-d);a=c*jspb.BinaryConstants.TWO_TO_20&1048575;c=c*jspb.BinaryConstants.TWO_TO_52>>>0;jspb.utils.split64High=(b<<31|d+1023<<20|a)>>>0;jspb.utils.split64Low=c}}; -jspb.utils.splitHash64=function(a){var b=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=a.charCodeAt(4),g=a.charCodeAt(5),h=a.charCodeAt(6);a=a.charCodeAt(7);jspb.utils.split64Low=b+(c<<8)+(d<<16)+(e<<24)>>>0;jspb.utils.split64High=f+(g<<8)+(h<<16)+(a<<24)>>>0};jspb.utils.joinUint64=function(a,b){return b*jspb.BinaryConstants.TWO_TO_32+a}; -jspb.utils.joinInt64=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinZigzag64=function(a,b){var c=a&1;a=(a>>>1|b<<31)>>>0;b>>>=1;c&&(a=a+1>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinFloat32=function(a,b){var c=2*(a>>31)+1,d=a>>>23&255,e=a&8388607;return 255==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-149)*e:c*Math.pow(2,d-150)*(e+Math.pow(2,23))}; -jspb.utils.joinFloat64=function(a,b){var c=2*(b>>31)+1,d=b>>>20&2047,e=jspb.BinaryConstants.TWO_TO_32*(b&1048575)+a;return 2047==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-1074)*e:c*Math.pow(2,d-1075)*(e+jspb.BinaryConstants.TWO_TO_52)};jspb.utils.joinHash64=function(a,b){return String.fromCharCode(a>>>0&255,a>>>8&255,a>>>16&255,a>>>24&255,b>>>0&255,b>>>8&255,b>>>16&255,b>>>24&255)};jspb.utils.DIGITS="0123456789abcdef".split(""); -jspb.utils.joinUnsignedDecimalString=function(a,b){function c(a){for(var b=1E7,c=0;7>c;c++){var b=b/10,d=a/b%10>>>0;if(0!=d||h)h=!0,k+=g[d]}}if(2097151>=b)return""+(jspb.BinaryConstants.TWO_TO_32*b+a);var d=(a>>>24|b<<8)>>>0&16777215,e=b>>16&65535,f=(a&16777215)+6777216*d+6710656*e,d=d+8147497*e,e=2*e;1E7<=f&&(d+=Math.floor(f/1E7),f%=1E7);1E7<=d&&(e+=Math.floor(d/1E7),d%=1E7);var g=jspb.utils.DIGITS,h=!1,k="";(e||h)&&c(e);(d||h)&&c(d);(f||h)&&c(f);return k}; -jspb.utils.joinSignedDecimalString=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b+(0==a?1:0)>>>0);var d=jspb.utils.joinUnsignedDecimalString(a,b);return c?"-"+d:d};jspb.utils.hash64ToDecimalString=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinSignedDecimalString(c,d):jspb.utils.joinUnsignedDecimalString(c,d)}; -jspb.utils.hash64ArrayToDecimalStrings=function(a,b){for(var c=Array(a.length),d=0;dc&&(1!==a||0>>8}}function c(){for(var a=0;8>a;a++)e[a]=~e[a]&255}goog.asserts.assert(0c;c++){var d=a.charCodeAt(7-c);b[2*c+2]=jspb.utils.DIGITS[d>>4];b[2*c+3]=jspb.utils.DIGITS[d&15]}return b.join("")};jspb.utils.hexStringToHash64=function(a){a=a.toLowerCase();goog.asserts.assert(18==a.length);goog.asserts.assert("0"==a[0]);goog.asserts.assert("x"==a[1]);for(var b="",c=0;8>c;c++)var d=jspb.utils.DIGITS.indexOf(a[2*c+2]),e=jspb.utils.DIGITS.indexOf(a[2*c+3]),b=String.fromCharCode(16*d+e)+b;return b}; -jspb.utils.hash64ToNumber=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinInt64(c,d):jspb.utils.joinUint64(c,d)};jspb.utils.numberToHash64=function(a){jspb.utils.splitInt64(a);return jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.utils.countVarints=function(a,b,c){for(var d=0,e=b;e>7;return c-b-d}; -jspb.utils.countVarintFields=function(a,b,c,d){var e=0;d=8*d+jspb.BinaryConstants.WireType.VARINT;if(128>d)for(;b>=7}if(a[b++]!=f)break;for(e++;f=a[b++],0!=(f&128););}return e};jspb.utils.countFixedFields_=function(a,b,c,d,e){var f=0;if(128>d)for(;b>=7}if(a[b++]!=g)break;f++;b+=e}return f}; -jspb.utils.countFixed32Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED32,4)};jspb.utils.countFixed64Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED64,8)}; -jspb.utils.countDelimitedFields=function(a,b,c,d){var e=0;for(d=8*d+jspb.BinaryConstants.WireType.DELIMITED;b>=7}if(a[b++]!=f)break;e++;for(var g=0,h=1;f=a[b++],g+=(f&127)*h,h*=128,0!=(f&128););b+=g}return e};jspb.utils.debugBytesToTextFormat=function(a){var b='"';if(a){a=jspb.utils.byteSourceToUint8Array(a);for(var c=0;ca[c]&&(b+="0"),b+=a[c].toString(16)}return b+'"'}; -jspb.utils.debugScalarToTextFormat=function(a){return goog.isString(a)?goog.string.quote(a):a.toString()};jspb.utils.stringToByteArray=function(a){for(var b=new Uint8Array(a.length),c=0;c>>7|b<<25)>>>0,b>>>=7;this.buffer_.push(a)}; jspb.BinaryEncoder.prototype.writeSplitFixed64=function(a,b){goog.asserts.assert(a==Math.floor(a));goog.asserts.assert(b==Math.floor(b));goog.asserts.assert(0<=a&&a>>=7;this.buffer_.push(a)}; @@ -691,61 +748,7 @@ jspb.BinaryWriter.prototype.writePackedSfixed32=function(a,b){if(null!=b&&b.leng jspb.BinaryWriter.prototype.writePackedSfixed64String=function(a,b){if(null!=b&&b.length){this.writeFieldHeader_(a,jspb.BinaryConstants.WireType.DELIMITED);this.encoder_.writeUnsignedVarint32(8*b.length);for(var c=0;cjspb.BinaryIterator.instanceCache_.length&&jspb.BinaryIterator.instanceCache_.push(this)}; -jspb.BinaryIterator.prototype.clear=function(){this.decoder_&&this.decoder_.free();this.elements_=this.nextMethod_=this.decoder_=null;this.cursor_=0;this.nextValue_=null;this.atEnd_=!0};jspb.BinaryIterator.prototype.get=function(){return this.nextValue_};jspb.BinaryIterator.prototype.atEnd=function(){return this.atEnd_}; -jspb.BinaryIterator.prototype.next=function(){var a=this.nextValue_;this.decoder_?this.decoder_.atEnd()?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.nextMethod_.call(this.decoder_):this.elements_&&(this.cursor_==this.elements_.length?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.elements_[this.cursor_++]);return a};jspb.BinaryDecoder=function(a,b,c){this.bytes_=null;this.tempHigh_=this.tempLow_=this.cursor_=this.end_=this.start_=0;this.error_=!1;a&&this.setBlock(a,b,c)}; -jspb.BinaryDecoder.instanceCache_=[];jspb.BinaryDecoder.alloc=function(a,b,c){if(jspb.BinaryDecoder.instanceCache_.length){var d=jspb.BinaryDecoder.instanceCache_.pop();a&&d.setBlock(a,b,c);return d}return new jspb.BinaryDecoder(a,b,c)};jspb.BinaryDecoder.prototype.free=function(){this.clear();100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)};jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)}; -jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null;this.cursor_=this.end_=this.start_=0;this.error_=!1};jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_};jspb.BinaryDecoder.prototype.setBlock=function(a,b,c){this.bytes_=jspb.utils.byteSourceToUint8Array(a);this.start_=goog.isDef(b)?b:0;this.end_=goog.isDef(c)?this.start_+c:this.bytes_.length;this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_}; -jspb.BinaryDecoder.prototype.setEnd=function(a){this.end_=a};jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_};jspb.BinaryDecoder.prototype.setCursor=function(a){this.cursor_=a};jspb.BinaryDecoder.prototype.advance=function(a){this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_)};jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_}; -jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_};jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_}; -jspb.BinaryDecoder.prototype.readSplitVarint64_=function(){for(var a,b=0,c,d=0;4>d;d++)if(a=this.bytes_[this.cursor_++],b|=(a&127)<<7*d,128>a){this.tempLow_=b>>>0;this.tempHigh_=0;return}a=this.bytes_[this.cursor_++];b|=(a&127)<<28;c=0|(a&127)>>4;if(128>a)this.tempLow_=b>>>0,this.tempHigh_=c>>>0;else{for(d=0;5>d;d++)if(a=this.bytes_[this.cursor_++],c|=(a&127)<<7*d+3,128>a){this.tempLow_=b>>>0;this.tempHigh_=c>>>0;return}goog.asserts.fail("Failed to read varint, encoding is invalid.");this.error_= -!0}};jspb.BinaryDecoder.prototype.skipVarint=function(){for(;this.bytes_[this.cursor_]&128;)this.cursor_++;this.cursor_++};jspb.BinaryDecoder.prototype.unskipVarint=function(a){for(;128>>=7;this.cursor_--}; -jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var a,b=this.bytes_;a=b[this.cursor_+0];var c=a&127;if(128>a)return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+1];c|=(a&127)<<7;if(128>a)return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+2];c|=(a&127)<<14;if(128>a)return this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+3];c|=(a&127)<<21;if(128>a)return this.cursor_+=4,goog.asserts.assert(this.cursor_<= -this.end_),c;a=b[this.cursor_+4];c|=(a&15)<<28;if(128>a)return this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),c>>>0;this.cursor_+=5;128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&goog.asserts.assert(!1);goog.asserts.assert(this.cursor_<=this.end_);return c};jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32;jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()}; -jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()};jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var a=this.readUnsignedVarint32();return a>>>1^-(a&1)};jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinUint64(this.tempLow_,this.tempHigh_)}; -jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinUnsignedDecimalString(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinInt64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinSignedDecimalString(this.tempLow_,this.tempHigh_)}; -jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinZigzag64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readZigzagVarint64().toString()};jspb.BinaryDecoder.prototype.readUint8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a}; -jspb.BinaryDecoder.prototype.readUint16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8};jspb.BinaryDecoder.prototype.readUint32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8|c<<16|d<<24)>>>0}; -jspb.BinaryDecoder.prototype.readUint64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUint64(a,b)};jspb.BinaryDecoder.prototype.readUint64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUnsignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readInt8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a<<24>>24}; -jspb.BinaryDecoder.prototype.readInt16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8)<<16>>16};jspb.BinaryDecoder.prototype.readInt32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8|c<<16|d<<24}; -jspb.BinaryDecoder.prototype.readInt64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinInt64(a,b)};jspb.BinaryDecoder.prototype.readInt64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinSignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readFloat=function(){var a=this.readUint32();return jspb.utils.joinFloat32(a,0)}; -jspb.BinaryDecoder.prototype.readDouble=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinFloat64(a,b)};jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]};jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()}; -jspb.BinaryDecoder.prototype.readString=function(a){var b=this.bytes_,c=this.cursor_;a=c+a;for(var d=[],e="";cf)d.push(f);else if(192>f)continue;else if(224>f){var g=b[c++];d.push((f&31)<<6|g&63)}else if(240>f){var g=b[c++],h=b[c++];d.push((f&15)<<12|(g&63)<<6|h&63)}else if(248>f){var g=b[c++],h=b[c++],k=b[c++],f=(f&7)<<18|(g&63)<<12|(h&63)<<6|k&63,f=f-65536;d.push((f>>10&1023)+55296,(f&1023)+56320)}8192<=d.length&&(e+=String.fromCharCode.apply(null,d),d.length=0)}e+=goog.crypt.byteArrayToString(d); -this.cursor_=c;return e};jspb.BinaryDecoder.prototype.readStringWithLength=function(){var a=this.readUnsignedVarint32();return this.readString(a)};jspb.BinaryDecoder.prototype.readBytes=function(a){if(0>a||this.cursor_+a>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var b=this.bytes_.subarray(this.cursor_,this.cursor_+a);this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_);return b}; -jspb.BinaryDecoder.prototype.readVarintHash64=function(){this.readSplitVarint64_();return jspb.utils.joinHash64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readFixedHash64=function(){var a=this.bytes_,b=this.cursor_,c=a[b+0],d=a[b+1],e=a[b+2],f=a[b+3],g=a[b+4],h=a[b+5],k=a[b+6],a=a[b+7];this.cursor_+=8;return String.fromCharCode(c,d,e,f,g,h,k,a)};jspb.BinaryReader=function(a,b,c){this.decoder_=jspb.BinaryDecoder.alloc(a,b,c);this.fieldCursor_=this.decoder_.getCursor();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null};jspb.BinaryReader.instanceCache_=[]; -jspb.BinaryReader.alloc=function(a,b,c){if(jspb.BinaryReader.instanceCache_.length){var d=jspb.BinaryReader.instanceCache_.pop();a&&d.decoder_.setBlock(a,b,c);return d}return new jspb.BinaryReader(a,b,c)};jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc; -jspb.BinaryReader.prototype.free=function(){this.decoder_.clear();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null;100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)};jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_};jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()}; -jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()};jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_};jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_};jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP};jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()}; -jspb.BinaryReader.prototype.setBlock=function(a,b,c){this.decoder_.setBlock(a,b,c);this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.advance=function(a){this.decoder_.advance(a)}; -jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var a=this.decoder_.readUnsignedVarint32(),b=a>>>3,a=a&7;if(a!=jspb.BinaryConstants.WireType.VARINT&&a!=jspb.BinaryConstants.WireType.FIXED32&&a!=jspb.BinaryConstants.WireType.FIXED64&&a!=jspb.BinaryConstants.WireType.DELIMITED&&a!=jspb.BinaryConstants.WireType.START_GROUP&&a!=jspb.BinaryConstants.WireType.END_GROUP)return goog.asserts.fail("Invalid wire type"), -this.error_=!0,!1;this.nextField_=b;this.nextWireType_=a;return!0};jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)};jspb.BinaryReader.prototype.skipMatchingFields=function(){var a=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==a;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()}; -jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()};jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var a=this.decoder_.readUnsignedVarint32();this.decoder_.advance(a)}}; -jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)};jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)}; -jspb.BinaryReader.prototype.skipGroup=function(){var a=[this.nextField_];do{if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF");this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP)a.push(this.nextField_);else if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP&&this.nextField_!=a.pop()){goog.asserts.fail("Unmatched end-group tag");this.error_=!0;break}}while(0 K_MAX_LENGTH) { - throw new RangeError('Invalid typed array length') + throw new RangeError('The value "' + length + '" is invalid for option "size"') } // Return an augmented `Uint8Array` instance var buf = new Uint8Array(length) @@ -999,8 +1001,8 @@ function Buffer (arg, encodingOrOffset, length) { // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' + throw new TypeError( + 'The "string" argument must be of type string. Received type number' ) } return allocUnsafe(arg) @@ -1009,7 +1011,7 @@ function Buffer (arg, encodingOrOffset, length) { } // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 -if (typeof Symbol !== 'undefined' && Symbol.species && +if (typeof Symbol !== 'undefined' && Symbol.species != null && Buffer[Symbol.species] === Buffer) { Object.defineProperty(Buffer, Symbol.species, { value: null, @@ -1022,19 +1024,51 @@ if (typeof Symbol !== 'undefined' && Symbol.species && Buffer.poolSize = 8192 // not used by this implementation function from (value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (isArrayBuffer(value) || (value && isArrayBuffer(value.buffer))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - if (typeof value === 'string') { return fromString(value, encodingOrOffset) } - return fromObject(value) + if (ArrayBuffer.isView(value)) { + return fromArrayLike(value) + } + + if (value == null) { + throw TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } + + var valueOf = value.valueOf && value.valueOf() + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } + + var b = fromObject(value) + if (b) return b + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from( + value[Symbol.toPrimitive]('string'), encodingOrOffset, length + ) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) } /** @@ -1058,7 +1092,7 @@ function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be of type number') } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') + throw new RangeError('The value "' + size + '" is invalid for option "size"') } } @@ -1173,20 +1207,16 @@ function fromObject (obj) { return buf } - if (obj) { - if (ArrayBuffer.isView(obj) || 'length' in obj) { - if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { - return createBuffer(0) - } - return fromArrayLike(obj) - } - - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - return fromArrayLike(obj.data) + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) } + return fromArrayLike(obj) } - throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.') + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } } function checked (length) { @@ -1207,12 +1237,17 @@ function SlowBuffer (length) { } Buffer.isBuffer = function isBuffer (b) { - return b != null && b._isBuffer === true + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false } Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError('Arguments must be Buffers') + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) } if (a === b) return 0 @@ -1273,7 +1308,7 @@ Buffer.concat = function concat (list, length) { var pos = 0 for (i = 0; i < list.length; ++i) { var buf = list[i] - if (ArrayBuffer.isView(buf)) { + if (isInstance(buf, Uint8Array)) { buf = Buffer.from(buf) } if (!Buffer.isBuffer(buf)) { @@ -1289,15 +1324,19 @@ function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } - if (ArrayBuffer.isView(string) || isArrayBuffer(string)) { + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { return string.byteLength } if (typeof string !== 'string') { - string = '' + string + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) } var len = string.length - if (len === 0) return 0 + var mustMatch = (arguments.length > 2 && arguments[2] === true) + if (!mustMatch && len === 0) return 0 // Use a for loop to avoid recursion var loweredCase = false @@ -1309,7 +1348,6 @@ function byteLength (string, encoding) { return len case 'utf8': case 'utf-8': - case undefined: return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': @@ -1321,7 +1359,9 @@ function byteLength (string, encoding) { case 'base64': return base64ToBytes(string).length default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } encoding = ('' + encoding).toLowerCase() loweredCase = true } @@ -1468,16 +1508,20 @@ Buffer.prototype.equals = function equals (b) { Buffer.prototype.inspect = function inspect () { var str = '' var max = exports.INSPECT_MAX_BYTES - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') - if (this.length > max) str += ' ... ' - } + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() + if (this.length > max) str += ' ... ' return '' } Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength) + } if (!Buffer.isBuffer(target)) { - throw new TypeError('Argument must be a Buffer') + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) } if (start === undefined) { @@ -1556,7 +1600,7 @@ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } - byteOffset = +byteOffset // Coerce to Number. + byteOffset = +byteOffset // Coerce to Number. if (numberIsNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : (buffer.length - 1) @@ -1808,8 +1852,8 @@ function utf8Slice (buf, start, end) { var codePoint = null var bytesPerSequence = (firstByte > 0xEF) ? 4 : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 + : (firstByte > 0xBF) ? 2 + : 1 if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint @@ -2472,7 +2516,7 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) { } else { var bytes = Buffer.isBuffer(val) ? val - : new Buffer(val, encoding) + : Buffer.from(val, encoding) var len = bytes.length if (len === 0) { throw new TypeError('The value "' + val + @@ -2627,19 +2671,21 @@ function blitBuffer (src, dst, offset, length) { return i } -// ArrayBuffers from another context (i.e. an iframe) do not pass the `instanceof` check -// but they should be treated as valid. See: https://github.com/feross/buffer/issues/166 -function isArrayBuffer (obj) { - return obj instanceof ArrayBuffer || - (obj != null && obj.constructor != null && obj.constructor.name === 'ArrayBuffer' && - typeof obj.byteLength === 'number') +// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass +// the `instanceof` check but they should be treated as of that type. +// See: https://github.com/feross/buffer/issues/166 +function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) } - function numberIsNaN (obj) { + // For IE11 support return obj !== obj // eslint-disable-line no-self-compare } -},{"base64-js":4,"ieee754":6}],6:[function(require,module,exports){ +}).call(this,require("buffer").Buffer) +},{"base64-js":4,"buffer":5,"ieee754":6}],6:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 diff --git a/cim_for_netty/cim-client-android/.idea/caches/build_file_checksums.ser b/cim_for_netty/cim-client-android/.idea/caches/build_file_checksums.ser index a489af5..b881f9f 100644 Binary files a/cim_for_netty/cim-client-android/.idea/caches/build_file_checksums.ser and b/cim_for_netty/cim-client-android/.idea/caches/build_file_checksums.ser differ diff --git a/cim_for_netty/cim-client-android/.idea/caches/gradle_models.ser b/cim_for_netty/cim-client-android/.idea/caches/gradle_models.ser index 733acfe..8132672 100644 Binary files a/cim_for_netty/cim-client-android/.idea/caches/gradle_models.ser and b/cim_for_netty/cim-client-android/.idea/caches/gradle_models.ser differ diff --git a/cim_for_netty/cim-client-android/app/build.gradle b/cim_for_netty/cim-client-android/app/build.gradle index 31794a3..6c426ea 100644 --- a/cim_for_netty/cim-client-android/app/build.gradle +++ b/cim_for_netty/cim-client-android/app/build.gradle @@ -33,11 +33,11 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.google.protobuf:protobuf-java:3.7.0' - implementation 'io.netty:netty-handler:4.1.34.Final' - implementation 'io.netty:netty-buffer:4.1.34.Final' - implementation 'io.netty:netty-codec:4.1.34.Final' - implementation 'io.netty:netty-transport:4.1.34.Final' - implementation 'io.netty:netty-common:4.1.34.Final' + implementation 'io.netty:netty-handler:4.1.35.Final' + implementation 'io.netty:netty-buffer:4.1.35.Final' + implementation 'io.netty:netty-codec:4.1.35.Final' + implementation 'io.netty:netty-transport:4.1.35.Final' + implementation 'io.netty:netty-common:4.1.35.Final' } diff --git a/cim_for_netty/cim-client-android/app/libs/cim-android-sdk-3.6.jar b/cim_for_netty/cim-client-android/app/libs/cim-android-sdk-3.6.jar index 1fe559f..770e0aa 100644 Binary files a/cim_for_netty/cim-client-android/app/libs/cim-android-sdk-3.6.jar and b/cim_for_netty/cim-client-android/app/libs/cim-android-sdk-3.6.jar differ diff --git a/cim_for_netty/cim-client-android/app/src/main/AndroidManifest.xml b/cim_for_netty/cim-client-android/app/src/main/AndroidManifest.xml index 8401962..69fcb1a 100644 --- a/cim_for_netty/cim-client-android/app/src/main/AndroidManifest.xml +++ b/cim_for_netty/cim-client-android/app/src/main/AndroidManifest.xml @@ -52,7 +52,7 @@ @@ -61,7 +61,8 @@ - + + diff --git a/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java index ed0aa1f..3955423 100644 --- a/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java +++ b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java @@ -90,11 +90,9 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick startActivity(intent); this.finish(); } else { - MediaPlayer.create(this, R.raw.classic).start(); list.add(message); adapter.notifyDataSetChanged(); chatListView.setSelection(chatListView.getTop()); - } } diff --git a/cim_for_netty/cim-client-android/app/src/main/res/raw/classic.mp3 b/cim_for_netty/cim-client-android/app/src/main/res/raw/classic.mp3 deleted file mode 100644 index 36412c0..0000000 Binary files a/cim_for_netty/cim-client-android/app/src/main/res/raw/classic.mp3 and /dev/null differ diff --git a/cim_for_netty/cim-java-sdk/.classpath b/cim_for_netty/cim-java-sdk/.classpath index 231cd3e..a9db105 100644 --- a/cim_for_netty/cim-java-sdk/.classpath +++ b/cim_for_netty/cim-java-sdk/.classpath @@ -2,7 +2,6 @@ - @@ -10,5 +9,6 @@ + diff --git a/cim_for_netty/cim-java-sdk/libs/protobuf-java-3.2.0.jar b/cim_for_netty/cim-java-sdk/libs/protobuf-java-3.2.0.jar deleted file mode 100644 index b1f9701..0000000 Binary files a/cim_for_netty/cim-java-sdk/libs/protobuf-java-3.2.0.jar and /dev/null differ diff --git a/cim_for_netty/cim-java-sdk/libs/protobuf-java-3.7.0.jar b/cim_for_netty/cim-java-sdk/libs/protobuf-java-3.7.0.jar new file mode 100644 index 0000000..eebaefe Binary files /dev/null and b/cim_for_netty/cim-java-sdk/libs/protobuf-java-3.7.0.jar differ diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java index 4d39ff4..59b47e7 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java @@ -107,7 +107,7 @@ public class ClientMessageDecoder extends ByteToMessageDecoder { if (CIMConstant.ProtobufType.MESSAGE == type) { MessageProto.Model bodyProto = MessageProto.Model.parseFrom(bytes); Message message = new Message(); - message.setMid(bodyProto.getMid()); + message.setId(bodyProto.getId()); message.setAction(bodyProto.getAction()); message.setContent(bodyProto.getContent()); message.setSender(bodyProto.getSender()); diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java index 70d8b4f..0d08017 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java @@ -33,7 +33,7 @@ public class Message implements Serializable { /** * 消息类型,用户自定义消息类别 */ - private String mid; + private long id; /** * 消息类型,用户自定义消息类别 @@ -72,6 +72,20 @@ public class Message implements Serializable { public Message() { timestamp = System.currentTimeMillis(); } + + + + public long getId() { + return id; + } + + + + public void setId(long id) { + this.id = id; + } + + public long getTimestamp() { return timestamp; @@ -141,7 +155,7 @@ public class Message implements Serializable { StringBuffer buffer = new StringBuffer(); buffer.append("#Message#").append("\n"); - buffer.append("mid:").append(mid).append("\n"); + buffer.append("id:").append(id).append("\n"); buffer.append("action:").append(action).append("\n"); buffer.append("title:").append(title).append("\n"); buffer.append("content:").append(content).append("\n"); @@ -153,13 +167,6 @@ public class Message implements Serializable { return buffer.toString(); } - public String getMid() { - return mid; - } - - public void setMid(String mid) { - this.mid = mid; - } public boolean isNotEmpty(String txt) { return txt != null && txt.trim().length() != 0; diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto index bd6d327..11918a8 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package com.farsunset.cim.sdk.model.proto; option java_outer_classname="MessageProto"; message Model { - string mid = 1; + int64 id = 1; string action = 2; string content = 3; string sender = 4; diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java index d0f7e2c..3cb763d 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java @@ -1,1562 +1,1556 @@ -/** - * Copyright 2013-2019 Xia Jun(3979434@qq.com). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - *************************************************************************************** - * * - * Website : http://www.farsunset.com * - * * - *************************************************************************************** - */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Message.proto + package com.farsunset.cim.sdk.model.proto; public final class MessageProto { - private MessageProto() { - } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - public interface ModelOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.model.proto.Model) - com.google.protobuf.MessageOrBuilder { - - /** - * string mid = 1; - */ - java.lang.String getMid(); - - /** - * string mid = 1; - */ - com.google.protobuf.ByteString getMidBytes(); - - /** - * string action = 2; - */ - java.lang.String getAction(); - - /** - * string action = 2; - */ - com.google.protobuf.ByteString getActionBytes(); - - /** - * string content = 3; - */ - java.lang.String getContent(); - - /** - * string content = 3; - */ - com.google.protobuf.ByteString getContentBytes(); - - /** - * string sender = 4; - */ - java.lang.String getSender(); - - /** - * string sender = 4; - */ - com.google.protobuf.ByteString getSenderBytes(); - - /** - * string receiver = 5; - */ - java.lang.String getReceiver(); - - /** - * string receiver = 5; - */ - com.google.protobuf.ByteString getReceiverBytes(); - - /** - * string extra = 6; - */ - java.lang.String getExtra(); - - /** - * string extra = 6; - */ - com.google.protobuf.ByteString getExtraBytes(); - - /** - * string title = 7; - */ - java.lang.String getTitle(); - - /** - * string title = 7; - */ - com.google.protobuf.ByteString getTitleBytes(); - - /** - * string format = 8; - */ - java.lang.String getFormat(); - - /** - * string format = 8; - */ - com.google.protobuf.ByteString getFormatBytes(); - - /** - * int64 timestamp = 9; - */ - long getTimestamp(); - } - - /** - * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} - */ - public static final class Model extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.model.proto.Model) - ModelOrBuilder { - // Use Model.newBuilder() to construct. - private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Model() { - mid_ = ""; - action_ = ""; - content_ = ""; - sender_ = ""; - receiver_ = ""; - extra_ = ""; - title_ = ""; - format_ = ""; - timestamp_ = 0L; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private Model(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - mid_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - action_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - content_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - sender_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - receiver_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - extra_ = s; - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - title_ = s; - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - format_ = s; - break; - } - case 72: { - - timestamp_ = input.readInt64(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable - .ensureFieldAccessorsInitialized(com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, - com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); - } - - public static final int MID_FIELD_NUMBER = 1; - private volatile java.lang.Object mid_; - - /** - * string mid = 1; - */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } - } - - /** - * string mid = 1; - */ - public com.google.protobuf.ByteString getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ACTION_FIELD_NUMBER = 2; - private volatile java.lang.Object action_; - - /** - * string action = 2; - */ - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } - } - - /** - * string action = 2; - */ - public com.google.protobuf.ByteString getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONTENT_FIELD_NUMBER = 3; - private volatile java.lang.Object content_; - - /** - * string content = 3; - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } - } - - /** - * string content = 3; - */ - public com.google.protobuf.ByteString getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SENDER_FIELD_NUMBER = 4; - private volatile java.lang.Object sender_; - - /** - * string sender = 4; - */ - public java.lang.String getSender() { - java.lang.Object ref = sender_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sender_ = s; - return s; - } - } - - /** - * string sender = 4; - */ - public com.google.protobuf.ByteString getSenderBytes() { - java.lang.Object ref = sender_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - sender_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RECEIVER_FIELD_NUMBER = 5; - private volatile java.lang.Object receiver_; - - /** - * string receiver = 5; - */ - public java.lang.String getReceiver() { - java.lang.Object ref = receiver_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - receiver_ = s; - return s; - } - } - - /** - * string receiver = 5; - */ - public com.google.protobuf.ByteString getReceiverBytes() { - java.lang.Object ref = receiver_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - receiver_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EXTRA_FIELD_NUMBER = 6; - private volatile java.lang.Object extra_; - - /** - * string extra = 6; - */ - public java.lang.String getExtra() { - java.lang.Object ref = extra_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - extra_ = s; - return s; - } - } - - /** - * string extra = 6; - */ - public com.google.protobuf.ByteString getExtraBytes() { - java.lang.Object ref = extra_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - extra_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TITLE_FIELD_NUMBER = 7; - private volatile java.lang.Object title_; - - /** - * string title = 7; - */ - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; - } - } - - /** - * string title = 7; - */ - public com.google.protobuf.ByteString getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FORMAT_FIELD_NUMBER = 8; - private volatile java.lang.Object format_; - - /** - * string format = 8; - */ - public java.lang.String getFormat() { - java.lang.Object ref = format_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - format_ = s; - return s; - } - } - - /** - * string format = 8; - */ - public com.google.protobuf.ByteString getFormatBytes() { - java.lang.Object ref = format_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - format_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMP_FIELD_NUMBER = 9; - private long timestamp_; - - /** - * int64 timestamp = 9; - */ - public long getTimestamp() { - return timestamp_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) - return true; - if (isInitialized == 0) - return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getMidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); - } - if (!getActionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); - } - if (!getContentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); - } - if (!getSenderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); - } - if (!getReceiverBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); - } - if (!getExtraBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); - } - if (!getTitleBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); - } - if (!getFormatBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); - } - if (timestamp_ != 0L) { - output.writeInt64(9, timestamp_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) - return size; - - size = 0; - if (!getMidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); - } - if (!getActionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); - } - if (!getContentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); - } - if (!getSenderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); - } - if (!getReceiverBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); - } - if (!getExtraBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); - } - if (!getTitleBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); - } - if (!getFormatBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); - } - if (timestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, timestamp_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model)) { - return super.equals(obj); - } - com.farsunset.cim.sdk.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) obj; - - boolean result = true; - result = result && getMid().equals(other.getMid()); - result = result && getAction().equals(other.getAction()); - result = result && getContent().equals(other.getContent()); - result = result && getSender().equals(other.getSender()); - result = result && getReceiver().equals(other.getReceiver()); - result = result && getExtra().equals(other.getExtra()); - result = result && getTitle().equals(other.getTitle()); - result = result && getFormat().equals(other.getFormat()); - result = result && (getTimestamp() == other.getTimestamp()); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + MID_FIELD_NUMBER; - hash = (53 * hash) + getMid().hashCode(); - hash = (37 * hash) + ACTION_FIELD_NUMBER; - hash = (53 * hash) + getAction().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - hash = (37 * hash) + SENDER_FIELD_NUMBER; - hash = (53 * hash) + getSender().hashCode(); - hash = (37 * hash) + RECEIVER_FIELD_NUMBER; - hash = (53 * hash) + getReceiver().hashCode(); - hash = (37 * hash) + EXTRA_FIELD_NUMBER; - hash = (53 * hash) + getExtra().hashCode(); - hash = (37 * hash) + TITLE_FIELD_NUMBER; - hash = (53 * hash) + getTitle().hashCode(); - hash = (37 * hash) + FORMAT_FIELD_NUMBER; - hash = (53 * hash) + getFormat().hashCode(); - hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTimestamp()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, - extensionRegistry); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.farsunset.cim.sdk.model.proto.MessageProto.Model prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.model.proto.Model) - com.farsunset.cim.sdk.model.proto.MessageProto.ModelOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable - .ensureFieldAccessorsInitialized(com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, - com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); - } - - // Construct using - // com.farsunset.cim.sdk.model.proto.MessageProto.Model.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - } - } - - public Builder clear() { - super.clear(); - mid_ = ""; - - action_ = ""; - - content_ = ""; - - sender_ = ""; - - receiver_ = ""; - - extra_ = ""; - - title_ = ""; - - format_ = ""; - - timestamp_ = 0L; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; - } - - public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { - return com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance(); - } - - public com.farsunset.cim.sdk.model.proto.MessageProto.Model build() { - com.farsunset.cim.sdk.model.proto.MessageProto.Model result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.farsunset.cim.sdk.model.proto.MessageProto.Model buildPartial() { - com.farsunset.cim.sdk.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.model.proto.MessageProto.Model( - this); - result.mid_ = mid_; - result.action_ = action_; - result.content_ = content_; - result.sender_ = sender_; - result.receiver_ = receiver_; - result.extra_ = extra_; - result.title_ = title_; - result.format_ = format_; - result.timestamp_ = timestamp_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, - Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model) { - return mergeFrom((com.farsunset.cim.sdk.model.proto.MessageProto.Model) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.farsunset.cim.sdk.model.proto.MessageProto.Model other) { - if (other == com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance()) - return this; - if (!other.getMid().isEmpty()) { - mid_ = other.mid_; - onChanged(); - } - if (!other.getAction().isEmpty()) { - action_ = other.action_; - onChanged(); - } - if (!other.getContent().isEmpty()) { - content_ = other.content_; - onChanged(); - } - if (!other.getSender().isEmpty()) { - sender_ = other.sender_; - onChanged(); - } - if (!other.getReceiver().isEmpty()) { - receiver_ = other.receiver_; - onChanged(); - } - if (!other.getExtra().isEmpty()) { - extra_ = other.extra_; - onChanged(); - } - if (!other.getTitle().isEmpty()) { - title_ = other.title_; - onChanged(); - } - if (!other.getFormat().isEmpty()) { - format_ = other.format_; - onChanged(); - } - if (other.getTimestamp() != 0L) { - setTimestamp(other.getTimestamp()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.farsunset.cim.sdk.model.proto.MessageProto.Model parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object mid_ = ""; - - /** - * string mid = 1; - */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string mid = 1; - */ - public com.google.protobuf.ByteString getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string mid = 1; - */ - public Builder setMid(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - mid_ = value; - onChanged(); - return this; - } - - /** - * string mid = 1; - */ - public Builder clearMid() { - - mid_ = getDefaultInstance().getMid(); - onChanged(); - return this; - } - - /** - * string mid = 1; - */ - public Builder setMidBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - mid_ = value; - onChanged(); - return this; - } - - private java.lang.Object action_ = ""; - - /** - * string action = 2; - */ - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string action = 2; - */ - public com.google.protobuf.ByteString getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string action = 2; - */ - public Builder setAction(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - action_ = value; - onChanged(); - return this; - } - - /** - * string action = 2; - */ - public Builder clearAction() { - - action_ = getDefaultInstance().getAction(); - onChanged(); - return this; - } - - /** - * string action = 2; - */ - public Builder setActionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - action_ = value; - onChanged(); - return this; - } - - private java.lang.Object content_ = ""; - - /** - * string content = 3; - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string content = 3; - */ - public com.google.protobuf.ByteString getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string content = 3; - */ - public Builder setContent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - - /** - * string content = 3; - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - onChanged(); - return this; - } - - /** - * string content = 3; - */ - public Builder setContentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - content_ = value; - onChanged(); - return this; - } - - private java.lang.Object sender_ = ""; - - /** - * string sender = 4; - */ - public java.lang.String getSender() { - java.lang.Object ref = sender_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sender_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string sender = 4; - */ - public com.google.protobuf.ByteString getSenderBytes() { - java.lang.Object ref = sender_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - sender_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string sender = 4; - */ - public Builder setSender(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - sender_ = value; - onChanged(); - return this; - } - - /** - * string sender = 4; - */ - public Builder clearSender() { - - sender_ = getDefaultInstance().getSender(); - onChanged(); - return this; - } - - /** - * string sender = 4; - */ - public Builder setSenderBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - sender_ = value; - onChanged(); - return this; - } - - private java.lang.Object receiver_ = ""; - - /** - * string receiver = 5; - */ - public java.lang.String getReceiver() { - java.lang.Object ref = receiver_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - receiver_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string receiver = 5; - */ - public com.google.protobuf.ByteString getReceiverBytes() { - java.lang.Object ref = receiver_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - receiver_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string receiver = 5; - */ - public Builder setReceiver(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - receiver_ = value; - onChanged(); - return this; - } - - /** - * string receiver = 5; - */ - public Builder clearReceiver() { - - receiver_ = getDefaultInstance().getReceiver(); - onChanged(); - return this; - } - - /** - * string receiver = 5; - */ - public Builder setReceiverBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - receiver_ = value; - onChanged(); - return this; - } - - private java.lang.Object extra_ = ""; - - /** - * string extra = 6; - */ - public java.lang.String getExtra() { - java.lang.Object ref = extra_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - extra_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string extra = 6; - */ - public com.google.protobuf.ByteString getExtraBytes() { - java.lang.Object ref = extra_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - extra_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string extra = 6; - */ - public Builder setExtra(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - extra_ = value; - onChanged(); - return this; - } - - /** - * string extra = 6; - */ - public Builder clearExtra() { - - extra_ = getDefaultInstance().getExtra(); - onChanged(); - return this; - } - - /** - * string extra = 6; - */ - public Builder setExtraBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - extra_ = value; - onChanged(); - return this; - } - - private java.lang.Object title_ = ""; - - /** - * string title = 7; - */ - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string title = 7; - */ - public com.google.protobuf.ByteString getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string title = 7; - */ - public Builder setTitle(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - title_ = value; - onChanged(); - return this; - } - - /** - * string title = 7; - */ - public Builder clearTitle() { - - title_ = getDefaultInstance().getTitle(); - onChanged(); - return this; - } - - /** - * string title = 7; - */ - public Builder setTitleBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - title_ = value; - onChanged(); - return this; - } - - private java.lang.Object format_ = ""; - - /** - * string format = 8; - */ - public java.lang.String getFormat() { - java.lang.Object ref = format_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - format_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string format = 8; - */ - public com.google.protobuf.ByteString getFormatBytes() { - java.lang.Object ref = format_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - format_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string format = 8; - */ - public Builder setFormat(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - format_ = value; - onChanged(); - return this; - } - - /** - * string format = 8; - */ - public Builder clearFormat() { - - format_ = getDefaultInstance().getFormat(); - onChanged(); - return this; - } - - /** - * string format = 8; - */ - public Builder setFormatBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - format_ = value; - onChanged(); - return this; - } - - private long timestamp_; - - /** - * int64 timestamp = 9; - */ - public long getTimestamp() { - return timestamp_; - } - - /** - * int64 timestamp = 9; - */ - public Builder setTimestamp(long value) { - - timestamp_ = value; - onChanged(); - return this; - } - - /** - * int64 timestamp = 9; - */ - public Builder clearTimestamp() { - - timestamp_ = 0L; - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.model.proto.Model) - } - - // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.model.proto.Model) - private static final com.farsunset.cim.sdk.model.proto.MessageProto.Model DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.farsunset.cim.sdk.model.proto.MessageProto.Model(); - } - - public static com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - public Model parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Model(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - static { - java.lang.String[] descriptorData = { "\n\rMessage.proto\022!com.farsunset.cim.sdk.m" - + "odel.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(\t\022\016\n\006act" - + "ion\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sender\030\004 \001" - + "(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001(\t\022\r\n\005t" - + "itle\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttimestamp\030" - + "\t \001(\003B\016B\014MessageProtob\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); - internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor, new java.lang.String[] { "Mid", - "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); - } - - // @@protoc_insertion_point(outer_class_scope) + private MessageProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 id = 1; + */ + long getId(); + + /** + * string action = 2; + */ + java.lang.String getAction(); + /** + * string action = 2; + */ + com.google.protobuf.ByteString + getActionBytes(); + + /** + * string content = 3; + */ + java.lang.String getContent(); + /** + * string content = 3; + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * string sender = 4; + */ + java.lang.String getSender(); + /** + * string sender = 4; + */ + com.google.protobuf.ByteString + getSenderBytes(); + + /** + * string receiver = 5; + */ + java.lang.String getReceiver(); + /** + * string receiver = 5; + */ + com.google.protobuf.ByteString + getReceiverBytes(); + + /** + * string extra = 6; + */ + java.lang.String getExtra(); + /** + * string extra = 6; + */ + com.google.protobuf.ByteString + getExtraBytes(); + + /** + * string title = 7; + */ + java.lang.String getTitle(); + /** + * string title = 7; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string format = 8; + */ + java.lang.String getFormat(); + /** + * string format = 8; + */ + com.google.protobuf.ByteString + getFormatBytes(); + + /** + * int64 timestamp = 9; + */ + long getTimestamp(); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.model.proto.Model) + ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + action_ = ""; + content_ = ""; + sender_ = ""; + receiver_ = ""; + extra_ = ""; + title_ = ""; + format_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + id_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + sender_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + receiver_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + extra_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 72: { + + timestamp_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + * int64 id = 1; + */ + public long getId() { + return id_; + } + + public static final int ACTION_FIELD_NUMBER = 2; + private volatile java.lang.Object action_; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private volatile java.lang.Object content_; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SENDER_FIELD_NUMBER = 4; + private volatile java.lang.Object sender_; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECEIVER_FIELD_NUMBER = 5; + private volatile java.lang.Object receiver_; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTRA_FIELD_NUMBER = 6; + private volatile java.lang.Object extra_; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 7; + private volatile java.lang.Object title_; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 8; + private volatile java.lang.Object format_; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private long timestamp_; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (!getSenderBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); + } + if (!getFormatBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); + } + if (timestamp_ != 0L) { + output.writeInt64(9, timestamp_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (!getSenderBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); + } + if (!getFormatBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, timestamp_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) obj; + + if (getId() + != other.getId()) return false; + if (!getAction() + .equals(other.getAction())) return false; + if (!getContent() + .equals(other.getContent())) return false; + if (!getSender() + .equals(other.getSender())) return false; + if (!getReceiver() + .equals(other.getReceiver())) return false; + if (!getExtra() + .equals(other.getExtra())) return false; + if (!getTitle() + .equals(other.getTitle())) return false; + if (!getFormat() + .equals(other.getFormat())) return false; + if (getTimestamp() + != other.getTimestamp()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SENDER_FIELD_NUMBER; + hash = (53 * hash) + getSender().hashCode(); + hash = (37 * hash) + RECEIVER_FIELD_NUMBER; + hash = (53 * hash) + getReceiver().hashCode(); + hash = (37 * hash) + EXTRA_FIELD_NUMBER; + hash = (53 * hash) + getExtra().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.model.proto.MessageProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.model.proto.Model) + com.farsunset.cim.sdk.model.proto.MessageProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.model.proto.MessageProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = 0L; + + action_ = ""; + + content_ = ""; + + sender_ = ""; + + receiver_ = ""; + + extra_ = ""; + + title_ = ""; + + format_ = ""; + + timestamp_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @java.lang.Override + public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance(); + } + + @java.lang.Override + public com.farsunset.cim.sdk.model.proto.MessageProto.Model build() { + com.farsunset.cim.sdk.model.proto.MessageProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.farsunset.cim.sdk.model.proto.MessageProto.Model buildPartial() { + com.farsunset.cim.sdk.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.model.proto.MessageProto.Model(this); + result.id_ = id_; + result.action_ = action_; + result.content_ = content_; + result.sender_ = sender_; + result.receiver_ = receiver_; + result.extra_ = extra_; + result.title_ = title_; + result.format_ = format_; + result.timestamp_ = timestamp_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.model.proto.MessageProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.model.proto.MessageProto.Model other) { + if (other == com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getSender().isEmpty()) { + sender_ = other.sender_; + onChanged(); + } + if (!other.getReceiver().isEmpty()) { + receiver_ = other.receiver_; + onChanged(); + } + if (!other.getExtra().isEmpty()) { + extra_ = other.extra_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.model.proto.MessageProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long id_ ; + /** + * int64 id = 1; + */ + public long getId() { + return id_; + } + /** + * int64 id = 1; + */ + public Builder setId(long value) { + + id_ = value; + onChanged(); + return this; + } + /** + * int64 id = 1; + */ + public Builder clearId() { + + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string action = 2; + */ + public Builder setAction( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder setActionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object sender_ = ""; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sender = 4; + */ + public Builder setSender( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sender_ = value; + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder clearSender() { + + sender_ = getDefaultInstance().getSender(); + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder setSenderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sender_ = value; + onChanged(); + return this; + } + + private java.lang.Object receiver_ = ""; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string receiver = 5; + */ + public Builder setReceiver( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + receiver_ = value; + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder clearReceiver() { + + receiver_ = getDefaultInstance().getReceiver(); + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder setReceiverBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + receiver_ = value; + onChanged(); + return this; + } + + private java.lang.Object extra_ = ""; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string extra = 6; + */ + public Builder setExtra( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + extra_ = value; + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder clearExtra() { + + extra_ = getDefaultInstance().getExtra(); + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder setExtraBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + extra_ = value; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 7; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object format_ = ""; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string format = 8; + */ + public Builder setFormat( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder setFormatBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 9; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 9; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.model.proto.Model) + private static final com.farsunset.cim.sdk.model.proto.MessageProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.model.proto.MessageProto.Model(); + } + + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rMessage.proto\022!com.farsunset.cim.sdk.m" + + "odel.proto\"\227\001\n\005Model\022\n\n\002id\030\001 \001(\003\022\016\n\006acti" + + "on\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sender\030\004 \001(" + + "\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001(\t\022\r\n\005ti" + + "tle\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttimestamp\030\t" + + " \001(\003B\016B\014MessageProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor, + new java.lang.String[] { "Id", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/cim_for_netty/cim-server-sdk/.classpath b/cim_for_netty/cim-server-sdk/.classpath index 7d38a09..baa75e4 100644 --- a/cim_for_netty/cim-server-sdk/.classpath +++ b/cim_for_netty/cim-server-sdk/.classpath @@ -1,18 +1,18 @@ - - - - - - + + + + + + diff --git a/cim_for_netty/cim-server-sdk/.settings/org.eclipse.jdt.core.prefs b/cim_for_netty/cim-server-sdk/.settings/org.eclipse.jdt.core.prefs index 0c68a61..87b7a7a 100644 --- a/cim_for_netty/cim-server-sdk/.settings/org.eclipse.jdt.core.prefs +++ b/cim_for_netty/cim-server-sdk/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,13 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.8 diff --git a/cim_for_netty/cim-server-sdk/.settings/org.eclipse.wst.common.project.facet.core.xml b/cim_for_netty/cim-server-sdk/.settings/org.eclipse.wst.common.project.facet.core.xml index 10c580d..c56e134 100644 --- a/cim_for_netty/cim-server-sdk/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/cim_for_netty/cim-server-sdk/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,5 +1,5 @@ - + diff --git a/cim_for_netty/cim-server-sdk/libs/protobuf-java-3.2.0.jar b/cim_for_netty/cim-server-sdk/libs/protobuf-java-3.2.0.jar deleted file mode 100644 index b1f9701..0000000 Binary files a/cim_for_netty/cim-server-sdk/libs/protobuf-java-3.2.0.jar and /dev/null differ diff --git a/cim_for_netty/cim-server-sdk/libs/protobuf-java-3.7.0.jar b/cim_for_netty/cim-server-sdk/libs/protobuf-java-3.7.0.jar new file mode 100644 index 0000000..eebaefe Binary files /dev/null and b/cim_for_netty/cim-server-sdk/libs/protobuf-java-3.7.0.jar differ diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java index e9e02ba..c271927 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java @@ -22,7 +22,6 @@ package com.farsunset.cim.sdk.server.model; import java.io.Serializable; - import com.farsunset.cim.sdk.server.constant.CIMConstant; import com.farsunset.cim.sdk.server.model.feature.EncodeFormatable; import com.farsunset.cim.sdk.server.model.proto.MessageProto; @@ -37,7 +36,7 @@ public class Message implements Serializable, EncodeFormatable { /** * 消息类型,用户自定义消息类别 */ - private String mid; + private long id; /** * 消息类型,用户自定义消息类别 @@ -77,6 +76,17 @@ public class Message implements Serializable, EncodeFormatable { timestamp = System.currentTimeMillis(); } + + public long getId() { + return id; + } + + + public void setId(long id) { + this.id = id; + } + + public long getTimestamp() { return timestamp; } @@ -141,19 +151,11 @@ public class Message implements Serializable, EncodeFormatable { this.extra = extra; } - public String getMid() { - return mid; - } - - public void setMid(String mid) { - this.mid = mid; - } - @Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("#Message#").append("\n"); - buffer.append("mid:").append(mid).append("\n"); + buffer.append("id:").append(id).append("\n"); buffer.append("action:").append(action).append("\n"); buffer.append("title:").append(title).append("\n"); buffer.append("content:").append(content).append("\n"); @@ -172,7 +174,7 @@ public class Message implements Serializable, EncodeFormatable { @Override public byte[] getProtobufBody() { MessageProto.Model.Builder builder = MessageProto.Model.newBuilder(); - builder.setMid(mid); + builder.setId(id); builder.setAction(action); builder.setSender(sender); builder.setReceiver(receiver); diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto index 677e574..69d9589 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package com.farsunset.cim.sdk.server.model.proto; option java_outer_classname="MessageProto"; message Model { - string mid = 1; + int64 id = 1; string action = 2; string content = 3; string sender = 4; diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java index 8aa073c..bf807e3 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java @@ -1,1566 +1,1556 @@ -/** - * Copyright 2013-2019 Xia Jun(3979434@qq.com). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - *************************************************************************************** - * * - * Website : http://www.farsunset.com * - * * - *************************************************************************************** - */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Message.proto + package com.farsunset.cim.sdk.server.model.proto; public final class MessageProto { - private MessageProto() { - } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - public interface ModelOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.server.model.proto.Model) - com.google.protobuf.MessageOrBuilder { - - /** - * string mid = 1; - */ - java.lang.String getMid(); - - /** - * string mid = 1; - */ - com.google.protobuf.ByteString getMidBytes(); - - /** - * string action = 2; - */ - java.lang.String getAction(); - - /** - * string action = 2; - */ - com.google.protobuf.ByteString getActionBytes(); - - /** - * string content = 3; - */ - java.lang.String getContent(); - - /** - * string content = 3; - */ - com.google.protobuf.ByteString getContentBytes(); - - /** - * string sender = 4; - */ - java.lang.String getSender(); - - /** - * string sender = 4; - */ - com.google.protobuf.ByteString getSenderBytes(); - - /** - * string receiver = 5; - */ - java.lang.String getReceiver(); - - /** - * string receiver = 5; - */ - com.google.protobuf.ByteString getReceiverBytes(); - - /** - * string extra = 6; - */ - java.lang.String getExtra(); - - /** - * string extra = 6; - */ - com.google.protobuf.ByteString getExtraBytes(); - - /** - * string title = 7; - */ - java.lang.String getTitle(); - - /** - * string title = 7; - */ - com.google.protobuf.ByteString getTitleBytes(); - - /** - * string format = 8; - */ - java.lang.String getFormat(); - - /** - * string format = 8; - */ - com.google.protobuf.ByteString getFormatBytes(); - - /** - * int64 timestamp = 9; - */ - long getTimestamp(); - } - - /** - * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} - */ - public static final class Model extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.server.model.proto.Model) - ModelOrBuilder { - // Use Model.newBuilder() to construct. - private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Model() { - mid_ = ""; - action_ = ""; - content_ = ""; - sender_ = ""; - receiver_ = ""; - extra_ = ""; - title_ = ""; - format_ = ""; - timestamp_ = 0L; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private Model(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - mid_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - action_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - content_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - sender_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - receiver_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - extra_ = s; - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - title_ = s; - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - format_ = s; - break; - } - case 72: { - - timestamp_ = input.readInt64(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable - .ensureFieldAccessorsInitialized(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); - } - - public static final int MID_FIELD_NUMBER = 1; - private volatile java.lang.Object mid_; - - /** - * string mid = 1; - */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } - } - - /** - * string mid = 1; - */ - public com.google.protobuf.ByteString getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ACTION_FIELD_NUMBER = 2; - private volatile java.lang.Object action_; - - /** - * string action = 2; - */ - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } - } - - /** - * string action = 2; - */ - public com.google.protobuf.ByteString getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONTENT_FIELD_NUMBER = 3; - private volatile java.lang.Object content_; - - /** - * string content = 3; - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } - } - - /** - * string content = 3; - */ - public com.google.protobuf.ByteString getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SENDER_FIELD_NUMBER = 4; - private volatile java.lang.Object sender_; - - /** - * string sender = 4; - */ - public java.lang.String getSender() { - java.lang.Object ref = sender_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sender_ = s; - return s; - } - } - - /** - * string sender = 4; - */ - public com.google.protobuf.ByteString getSenderBytes() { - java.lang.Object ref = sender_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - sender_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RECEIVER_FIELD_NUMBER = 5; - private volatile java.lang.Object receiver_; - - /** - * string receiver = 5; - */ - public java.lang.String getReceiver() { - java.lang.Object ref = receiver_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - receiver_ = s; - return s; - } - } - - /** - * string receiver = 5; - */ - public com.google.protobuf.ByteString getReceiverBytes() { - java.lang.Object ref = receiver_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - receiver_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EXTRA_FIELD_NUMBER = 6; - private volatile java.lang.Object extra_; - - /** - * string extra = 6; - */ - public java.lang.String getExtra() { - java.lang.Object ref = extra_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - extra_ = s; - return s; - } - } - - /** - * string extra = 6; - */ - public com.google.protobuf.ByteString getExtraBytes() { - java.lang.Object ref = extra_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - extra_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TITLE_FIELD_NUMBER = 7; - private volatile java.lang.Object title_; - - /** - * string title = 7; - */ - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; - } - } - - /** - * string title = 7; - */ - public com.google.protobuf.ByteString getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FORMAT_FIELD_NUMBER = 8; - private volatile java.lang.Object format_; - - /** - * string format = 8; - */ - public java.lang.String getFormat() { - java.lang.Object ref = format_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - format_ = s; - return s; - } - } - - /** - * string format = 8; - */ - public com.google.protobuf.ByteString getFormatBytes() { - java.lang.Object ref = format_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - format_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMP_FIELD_NUMBER = 9; - private long timestamp_; - - /** - * int64 timestamp = 9; - */ - public long getTimestamp() { - return timestamp_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) - return true; - if (isInitialized == 0) - return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getMidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); - } - if (!getActionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); - } - if (!getContentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); - } - if (!getSenderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); - } - if (!getReceiverBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); - } - if (!getExtraBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); - } - if (!getTitleBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); - } - if (!getFormatBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); - } - if (timestamp_ != 0L) { - output.writeInt64(9, timestamp_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) - return size; - - size = 0; - if (!getMidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); - } - if (!getActionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); - } - if (!getContentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); - } - if (!getSenderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); - } - if (!getReceiverBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); - } - if (!getExtraBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); - } - if (!getTitleBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); - } - if (!getFormatBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); - } - if (timestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, timestamp_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model)) { - return super.equals(obj); - } - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) obj; - - boolean result = true; - result = result && getMid().equals(other.getMid()); - result = result && getAction().equals(other.getAction()); - result = result && getContent().equals(other.getContent()); - result = result && getSender().equals(other.getSender()); - result = result && getReceiver().equals(other.getReceiver()); - result = result && getExtra().equals(other.getExtra()); - result = result && getTitle().equals(other.getTitle()); - result = result && getFormat().equals(other.getFormat()); - result = result && (getTimestamp() == other.getTimestamp()); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + MID_FIELD_NUMBER; - hash = (53 * hash) + getMid().hashCode(); - hash = (37 * hash) + ACTION_FIELD_NUMBER; - hash = (53 * hash) + getAction().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - hash = (37 * hash) + SENDER_FIELD_NUMBER; - hash = (53 * hash) + getSender().hashCode(); - hash = (37 * hash) + RECEIVER_FIELD_NUMBER; - hash = (53 * hash) + getReceiver().hashCode(); - hash = (37 * hash) + EXTRA_FIELD_NUMBER; - hash = (53 * hash) + getExtra().hashCode(); - hash = (37 * hash) + TITLE_FIELD_NUMBER; - hash = (53 * hash) + getTitle().hashCode(); - hash = (37 * hash) + FORMAT_FIELD_NUMBER; - hash = (53 * hash) + getFormat().hashCode(); - hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTimestamp()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, - extensionRegistry); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( - com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.server.model.proto.Model) - com.farsunset.cim.sdk.server.model.proto.MessageProto.ModelOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); - } - - // Construct using - // com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - } - } - - public Builder clear() { - super.clear(); - mid_ = ""; - - action_ = ""; - - content_ = ""; - - sender_ = ""; - - receiver_ = ""; - - extra_ = ""; - - title_ = ""; - - format_ = ""; - - timestamp_ = 0L; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; - } - - public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { - return com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance(); - } - - public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model build() { - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model buildPartial() { - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model( - this); - result.mid_ = mid_; - result.action_ = action_; - result.content_ = content_; - result.sender_ = sender_; - result.receiver_ = receiver_; - result.extra_ = extra_; - result.title_ = title_; - result.format_ = format_; - result.timestamp_ = timestamp_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, - Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) { - return mergeFrom((com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other) { - if (other == com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance()) - return this; - if (!other.getMid().isEmpty()) { - mid_ = other.mid_; - onChanged(); - } - if (!other.getAction().isEmpty()) { - action_ = other.action_; - onChanged(); - } - if (!other.getContent().isEmpty()) { - content_ = other.content_; - onChanged(); - } - if (!other.getSender().isEmpty()) { - sender_ = other.sender_; - onChanged(); - } - if (!other.getReceiver().isEmpty()) { - receiver_ = other.receiver_; - onChanged(); - } - if (!other.getExtra().isEmpty()) { - extra_ = other.extra_; - onChanged(); - } - if (!other.getTitle().isEmpty()) { - title_ = other.title_; - onChanged(); - } - if (!other.getFormat().isEmpty()) { - format_ = other.format_; - onChanged(); - } - if (other.getTimestamp() != 0L) { - setTimestamp(other.getTimestamp()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) e - .getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object mid_ = ""; - - /** - * string mid = 1; - */ - public java.lang.String getMid() { - java.lang.Object ref = mid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string mid = 1; - */ - public com.google.protobuf.ByteString getMidBytes() { - java.lang.Object ref = mid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - mid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string mid = 1; - */ - public Builder setMid(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - mid_ = value; - onChanged(); - return this; - } - - /** - * string mid = 1; - */ - public Builder clearMid() { - - mid_ = getDefaultInstance().getMid(); - onChanged(); - return this; - } - - /** - * string mid = 1; - */ - public Builder setMidBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - mid_ = value; - onChanged(); - return this; - } - - private java.lang.Object action_ = ""; - - /** - * string action = 2; - */ - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string action = 2; - */ - public com.google.protobuf.ByteString getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string action = 2; - */ - public Builder setAction(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - action_ = value; - onChanged(); - return this; - } - - /** - * string action = 2; - */ - public Builder clearAction() { - - action_ = getDefaultInstance().getAction(); - onChanged(); - return this; - } - - /** - * string action = 2; - */ - public Builder setActionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - action_ = value; - onChanged(); - return this; - } - - private java.lang.Object content_ = ""; - - /** - * string content = 3; - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string content = 3; - */ - public com.google.protobuf.ByteString getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string content = 3; - */ - public Builder setContent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - - /** - * string content = 3; - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - onChanged(); - return this; - } - - /** - * string content = 3; - */ - public Builder setContentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - content_ = value; - onChanged(); - return this; - } - - private java.lang.Object sender_ = ""; - - /** - * string sender = 4; - */ - public java.lang.String getSender() { - java.lang.Object ref = sender_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sender_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string sender = 4; - */ - public com.google.protobuf.ByteString getSenderBytes() { - java.lang.Object ref = sender_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - sender_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string sender = 4; - */ - public Builder setSender(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - sender_ = value; - onChanged(); - return this; - } - - /** - * string sender = 4; - */ - public Builder clearSender() { - - sender_ = getDefaultInstance().getSender(); - onChanged(); - return this; - } - - /** - * string sender = 4; - */ - public Builder setSenderBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - sender_ = value; - onChanged(); - return this; - } - - private java.lang.Object receiver_ = ""; - - /** - * string receiver = 5; - */ - public java.lang.String getReceiver() { - java.lang.Object ref = receiver_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - receiver_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string receiver = 5; - */ - public com.google.protobuf.ByteString getReceiverBytes() { - java.lang.Object ref = receiver_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - receiver_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string receiver = 5; - */ - public Builder setReceiver(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - receiver_ = value; - onChanged(); - return this; - } - - /** - * string receiver = 5; - */ - public Builder clearReceiver() { - - receiver_ = getDefaultInstance().getReceiver(); - onChanged(); - return this; - } - - /** - * string receiver = 5; - */ - public Builder setReceiverBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - receiver_ = value; - onChanged(); - return this; - } - - private java.lang.Object extra_ = ""; - - /** - * string extra = 6; - */ - public java.lang.String getExtra() { - java.lang.Object ref = extra_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - extra_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string extra = 6; - */ - public com.google.protobuf.ByteString getExtraBytes() { - java.lang.Object ref = extra_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - extra_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string extra = 6; - */ - public Builder setExtra(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - extra_ = value; - onChanged(); - return this; - } - - /** - * string extra = 6; - */ - public Builder clearExtra() { - - extra_ = getDefaultInstance().getExtra(); - onChanged(); - return this; - } - - /** - * string extra = 6; - */ - public Builder setExtraBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - extra_ = value; - onChanged(); - return this; - } - - private java.lang.Object title_ = ""; - - /** - * string title = 7; - */ - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string title = 7; - */ - public com.google.protobuf.ByteString getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string title = 7; - */ - public Builder setTitle(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - title_ = value; - onChanged(); - return this; - } - - /** - * string title = 7; - */ - public Builder clearTitle() { - - title_ = getDefaultInstance().getTitle(); - onChanged(); - return this; - } - - /** - * string title = 7; - */ - public Builder setTitleBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - title_ = value; - onChanged(); - return this; - } - - private java.lang.Object format_ = ""; - - /** - * string format = 8; - */ - public java.lang.String getFormat() { - java.lang.Object ref = format_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - format_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string format = 8; - */ - public com.google.protobuf.ByteString getFormatBytes() { - java.lang.Object ref = format_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString - .copyFromUtf8((java.lang.String) ref); - format_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string format = 8; - */ - public Builder setFormat(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - format_ = value; - onChanged(); - return this; - } - - /** - * string format = 8; - */ - public Builder clearFormat() { - - format_ = getDefaultInstance().getFormat(); - onChanged(); - return this; - } - - /** - * string format = 8; - */ - public Builder setFormatBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - format_ = value; - onChanged(); - return this; - } - - private long timestamp_; - - /** - * int64 timestamp = 9; - */ - public long getTimestamp() { - return timestamp_; - } - - /** - * int64 timestamp = 9; - */ - public Builder setTimestamp(long value) { - - timestamp_ = value; - onChanged(); - return this; - } - - /** - * int64 timestamp = 9; - */ - public Builder clearTimestamp() { - - timestamp_ = 0L; - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.server.model.proto.Model) - } - - // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.server.model.proto.Model) - private static final com.farsunset.cim.sdk.server.model.proto.MessageProto.Model DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model(); - } - - public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - public Model parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Model(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - static { - java.lang.String[] descriptorData = { "\n\rMessage.proto\022(com.farsunset.cim.sdk.s" - + "erver.model.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(\t" - + "\022\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sen" - + "der\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001" - + "(\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttim" - + "estamp\030\t \001(\003B\016B\014MessageProtob\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); - internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor = getDescriptor().getMessageTypes() - .get(0); - internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor, new java.lang.String[] { - "Mid", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); - } - - // @@protoc_insertion_point(outer_class_scope) + private MessageProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.server.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 id = 1; + */ + long getId(); + + /** + * string action = 2; + */ + java.lang.String getAction(); + /** + * string action = 2; + */ + com.google.protobuf.ByteString + getActionBytes(); + + /** + * string content = 3; + */ + java.lang.String getContent(); + /** + * string content = 3; + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * string sender = 4; + */ + java.lang.String getSender(); + /** + * string sender = 4; + */ + com.google.protobuf.ByteString + getSenderBytes(); + + /** + * string receiver = 5; + */ + java.lang.String getReceiver(); + /** + * string receiver = 5; + */ + com.google.protobuf.ByteString + getReceiverBytes(); + + /** + * string extra = 6; + */ + java.lang.String getExtra(); + /** + * string extra = 6; + */ + com.google.protobuf.ByteString + getExtraBytes(); + + /** + * string title = 7; + */ + java.lang.String getTitle(); + /** + * string title = 7; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string format = 8; + */ + java.lang.String getFormat(); + /** + * string format = 8; + */ + com.google.protobuf.ByteString + getFormatBytes(); + + /** + * int64 timestamp = 9; + */ + long getTimestamp(); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.server.model.proto.Model) + ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + action_ = ""; + content_ = ""; + sender_ = ""; + receiver_ = ""; + extra_ = ""; + title_ = ""; + format_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + id_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + sender_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + receiver_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + extra_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 72: { + + timestamp_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + * int64 id = 1; + */ + public long getId() { + return id_; + } + + public static final int ACTION_FIELD_NUMBER = 2; + private volatile java.lang.Object action_; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private volatile java.lang.Object content_; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SENDER_FIELD_NUMBER = 4; + private volatile java.lang.Object sender_; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECEIVER_FIELD_NUMBER = 5; + private volatile java.lang.Object receiver_; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTRA_FIELD_NUMBER = 6; + private volatile java.lang.Object extra_; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 7; + private volatile java.lang.Object title_; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 8; + private volatile java.lang.Object format_; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private long timestamp_; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (!getSenderBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); + } + if (!getFormatBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); + } + if (timestamp_ != 0L) { + output.writeInt64(9, timestamp_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (!getSenderBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); + } + if (!getFormatBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, timestamp_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) obj; + + if (getId() + != other.getId()) return false; + if (!getAction() + .equals(other.getAction())) return false; + if (!getContent() + .equals(other.getContent())) return false; + if (!getSender() + .equals(other.getSender())) return false; + if (!getReceiver() + .equals(other.getReceiver())) return false; + if (!getExtra() + .equals(other.getExtra())) return false; + if (!getTitle() + .equals(other.getTitle())) return false; + if (!getFormat() + .equals(other.getFormat())) return false; + if (getTimestamp() + != other.getTimestamp()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SENDER_FIELD_NUMBER; + hash = (53 * hash) + getSender().hashCode(); + hash = (37 * hash) + RECEIVER_FIELD_NUMBER; + hash = (53 * hash) + getReceiver().hashCode(); + hash = (37 * hash) + EXTRA_FIELD_NUMBER; + hash = (53 * hash) + getExtra().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.server.model.proto.Model) + com.farsunset.cim.sdk.server.model.proto.MessageProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = 0L; + + action_ = ""; + + content_ = ""; + + sender_ = ""; + + receiver_ = ""; + + extra_ = ""; + + title_ = ""; + + format_ = ""; + + timestamp_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @java.lang.Override + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance(); + } + + @java.lang.Override + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model build() { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model buildPartial() { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model(this); + result.id_ = id_; + result.action_ = action_; + result.content_ = content_; + result.sender_ = sender_; + result.receiver_ = receiver_; + result.extra_ = extra_; + result.title_ = title_; + result.format_ = format_; + result.timestamp_ = timestamp_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.server.model.proto.MessageProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other) { + if (other == com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getSender().isEmpty()) { + sender_ = other.sender_; + onChanged(); + } + if (!other.getReceiver().isEmpty()) { + receiver_ = other.receiver_; + onChanged(); + } + if (!other.getExtra().isEmpty()) { + extra_ = other.extra_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long id_ ; + /** + * int64 id = 1; + */ + public long getId() { + return id_; + } + /** + * int64 id = 1; + */ + public Builder setId(long value) { + + id_ = value; + onChanged(); + return this; + } + /** + * int64 id = 1; + */ + public Builder clearId() { + + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string action = 2; + */ + public Builder setAction( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder setActionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object sender_ = ""; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sender = 4; + */ + public Builder setSender( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sender_ = value; + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder clearSender() { + + sender_ = getDefaultInstance().getSender(); + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder setSenderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sender_ = value; + onChanged(); + return this; + } + + private java.lang.Object receiver_ = ""; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string receiver = 5; + */ + public Builder setReceiver( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + receiver_ = value; + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder clearReceiver() { + + receiver_ = getDefaultInstance().getReceiver(); + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder setReceiverBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + receiver_ = value; + onChanged(); + return this; + } + + private java.lang.Object extra_ = ""; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string extra = 6; + */ + public Builder setExtra( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + extra_ = value; + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder clearExtra() { + + extra_ = getDefaultInstance().getExtra(); + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder setExtraBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + extra_ = value; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 7; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object format_ = ""; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string format = 8; + */ + public Builder setFormat( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder setFormatBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 9; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 9; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.server.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.server.model.proto.Model) + private static final com.farsunset.cim.sdk.server.model.proto.MessageProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model(); + } + + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rMessage.proto\022(com.farsunset.cim.sdk.s" + + "erver.model.proto\"\227\001\n\005Model\022\n\n\002id\030\001 \001(\003\022" + + "\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006send" + + "er\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001(" + + "\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttime" + + "stamp\030\t \001(\003B\016B\014MessageProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor, + new java.lang.String[] { "Id", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/doc/proto/java/Message.proto b/doc/proto/java/Message.proto index a5cb5ee..aee4268 100644 --- a/doc/proto/java/Message.proto +++ b/doc/proto/java/Message.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package com.farsunset.cim.sdk.android.model.proto; option java_outer_classname="MessageProto"; message Model { - string mid = 1; + int64 id = 1; string action = 2; string content = 3; string sender = 4; diff --git a/doc/proto/js/Message.proto b/doc/proto/js/Message.proto index 205d87a..17c7afa 100644 --- a/doc/proto/js/Message.proto +++ b/doc/proto/js/Message.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package com.farsunset.cim.sdk.web.model; message Message { - string mid = 1; + int64 id = 1; string action = 2; string content = 3; string sender = 4; diff --git a/doc/proto/js/message.js b/doc/proto/js/message.js index 644e760..30b942a 100644 --- a/doc/proto/js/message.js +++ b/doc/proto/js/message.js @@ -13,7 +13,6 @@ var goog = jspb; var global = Function('return this')(); goog.exportSymbol('proto.com.farsunset.cim.sdk.web.model.Message', null, global); - /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -29,10 +28,15 @@ proto.com.farsunset.cim.sdk.web.model.Message = function(opt_data) { }; goog.inherits(proto.com.farsunset.cim.sdk.web.model.Message, jspb.Message); if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ proto.com.farsunset.cim.sdk.web.model.Message.displayName = 'proto.com.farsunset.cim.sdk.web.model.Message'; } + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. @@ -59,8 +63,8 @@ proto.com.farsunset.cim.sdk.web.model.Message.prototype.toObject = function(opt_ * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.com.farsunset.cim.sdk.web.model.Message.toObject = function(includeInstance, msg) { - var f, obj = { - mid: jspb.Message.getFieldWithDefault(msg, 1, ""), + var obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, 0), action: jspb.Message.getFieldWithDefault(msg, 2, ""), content: jspb.Message.getFieldWithDefault(msg, 3, ""), sender: jspb.Message.getFieldWithDefault(msg, 4, ""), @@ -106,8 +110,8 @@ proto.com.farsunset.cim.sdk.web.model.Message.deserializeBinaryFromReader = func var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setMid(value); + var value = /** @type {number} */ (reader.readInt64()); + msg.setId(value); break; case 2: var value = /** @type {string} */ (reader.readString()); @@ -170,9 +174,9 @@ proto.com.farsunset.cim.sdk.web.model.Message.prototype.serializeBinary = functi */ proto.com.farsunset.cim.sdk.web.model.Message.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getMid(); - if (f.length > 0) { - writer.writeString( + f = message.getId(); + if (f !== 0) { + writer.writeInt64( 1, f ); @@ -237,17 +241,17 @@ proto.com.farsunset.cim.sdk.web.model.Message.serializeBinaryToWriter = function /** - * optional string mid = 1; - * @return {string} + * optional int64 id = 1; + * @return {number} */ -proto.com.farsunset.cim.sdk.web.model.Message.prototype.getMid = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.com.farsunset.cim.sdk.web.model.Message.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; -/** @param {string} value */ -proto.com.farsunset.cim.sdk.web.model.Message.prototype.setMid = function(value) { - jspb.Message.setProto3StringField(this, 1, value); +/** @param {number} value */ +proto.com.farsunset.cim.sdk.web.model.Message.prototype.setId = function(value) { + jspb.Message.setProto3IntField(this, 1, value); }; @@ -374,12 +378,12 @@ proto.com.farsunset.cim.sdk.web.model.Message.prototype.setTimestamp = function( goog.object.extend(exports, proto.com.farsunset.cim.sdk.web.model); },{"google-protobuf":3}],2:[function(require,module,exports){ -var messageProtobuf= require('./MessageProtobuf'); +var myProto = require('./Message_pb'); module.exports = { - DataProto: messageProtobuf + DataProto: myProto } -},{"./MessageProtobuf":1}],3:[function(require,module,exports){ +},{"./Message_pb":1}],3:[function(require,module,exports){ (function (global,Buffer){ var $jscomp={scope:{},getGlobal:function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global?global:a}};$jscomp.global=$jscomp.getGlobal(this);$jscomp.initSymbol=function(){$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol);$jscomp.initSymbol=function(){}};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(a){return"jscomp_symbol_"+a+$jscomp.symbolCounter_++}; $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();$jscomp.global.Symbol.iterator||($jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));$jscomp.initSymbolIterator=function(){}};$jscomp.makeIterator=function(a){$jscomp.initSymbolIterator();$jscomp.initSymbol();$jscomp.initSymbolIterator();var b=a[Symbol.iterator];if(b)return b.call(a);var c=0;return{next:function(){return c=a||"\u0080"<=a&&"\ufffd">=a};goog.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};goog.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")}; @@ -485,16 +492,7 @@ goog.asserts.assertString=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isS goog.asserts.assertObject=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isObject(a)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertArray=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isArray(a)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a}; goog.asserts.assertBoolean=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(a)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertElement=function(a,b,c){!goog.asserts.ENABLE_ASSERTS||goog.isObject(a)&&a.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a}; goog.asserts.assertInstanceof=function(a,b,c,d){!goog.asserts.ENABLE_ASSERTS||a instanceof b||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(b),goog.asserts.getType_(a)],c,Array.prototype.slice.call(arguments,3));return a};goog.asserts.assertObjectPrototypeIsIntact=function(){for(var a in Object.prototype)goog.asserts.fail(a+" should not be enumerable in Object.prototype.")}; -goog.asserts.getType_=function(a){return a instanceof Function?a.displayName||a.name||"unknown type name":a instanceof Object?a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a):null===a?"null":typeof a};var jspb={Map:function(a,b){this.arr_=a;this.valueCtor_=b;this.map_={};this.arrClean=!0;0c?Math.max(0,a.length+c):c;if(goog.isString(a))return goog.isString(b)&&1==b.length?a.indexOf(b,c):-1;for(;cc&&(c=Math.max(0,a.length+c));if(goog.isString(a))return goog.isString(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in a&&a[c]===b)return c;return-1}; goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(a,b,c){goog.asserts.assert(null!=a.length);Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f>4);64!=g&&(b(f<<4&240|g>>2),64!=h&&b(g<<6&192|h))}}; goog.crypt.base64.init_=function(){if(!goog.crypt.base64.byteToCharMap_){goog.crypt.base64.byteToCharMap_={};goog.crypt.base64.charToByteMap_={};goog.crypt.base64.byteToCharMapWebSafe_={};for(var a=0;a=goog.crypt.base64.ENCODED_VALS_BASE.length&& -(goog.crypt.base64.charToByteMap_[goog.crypt.base64.ENCODED_VALS_WEBSAFE.charAt(a)]=a)}};jspb.ExtensionFieldInfo=function(a,b,c,d,e){this.fieldIndex=a;this.fieldName=b;this.ctor=c;this.toObjectFn=d;this.isRepeated=e};jspb.ExtensionFieldBinaryInfo=function(a,b,c,d,e,f){this.fieldInfo=a;this.binaryReaderFn=b;this.binaryWriterFn=c;this.binaryMessageSerializeFn=d;this.binaryMessageDeserializeFn=e;this.isPacked=f};jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor};jspb.Message=function(){};jspb.Message.GENERATE_TO_OBJECT=!0;jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE; +(goog.crypt.base64.charToByteMap_[goog.crypt.base64.ENCODED_VALS_WEBSAFE.charAt(a)]=a)}};jspb.utils={};jspb.utils.split64Low=0;jspb.utils.split64High=0;jspb.utils.splitUint64=function(a){var b=a>>>0;a=Math.floor((a-b)/jspb.BinaryConstants.TWO_TO_32)>>>0;jspb.utils.split64Low=b;jspb.utils.split64High=a};jspb.utils.splitInt64=function(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/jspb.BinaryConstants.TWO_TO_32);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295a;a=2*Math.abs(a);jspb.utils.splitUint64(a);a=jspb.utils.split64Low;var c=jspb.utils.split64High;b&&(0==a?0==c?c=a=4294967295:(c--,a=4294967295):a--);jspb.utils.split64Low=a;jspb.utils.split64High=c}; +jspb.utils.splitFloat32=function(a){var b=0>a?1:0;a=b?-a:a;var c;0===a?0<1/a?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648):isNaN(a)?(jspb.utils.split64High=0,jspb.utils.split64Low=2147483647):a>jspb.BinaryConstants.FLOAT32_MAX?(jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|2139095040)>>>0):a>>0):(c=Math.floor(Math.log(a)/ +Math.LN2),a*=Math.pow(2,-c),a=Math.round(a*jspb.BinaryConstants.TWO_TO_23)&8388607,jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|c+127<<23|a)>>>0)}; +jspb.utils.splitFloat64=function(a){var b=0>a?1:0;a=b?-a:a;if(0===a)jspb.utils.split64High=0<1/a?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(a))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(a>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(b<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(a>>0;jspb.utils.split64Low=c>>>0}else{var d= +Math.floor(Math.log(a)/Math.LN2);1024==d&&(d=1023);c=a*Math.pow(2,-d);a=c*jspb.BinaryConstants.TWO_TO_20&1048575;c=c*jspb.BinaryConstants.TWO_TO_52>>>0;jspb.utils.split64High=(b<<31|d+1023<<20|a)>>>0;jspb.utils.split64Low=c}}; +jspb.utils.splitHash64=function(a){var b=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=a.charCodeAt(4),g=a.charCodeAt(5),h=a.charCodeAt(6);a=a.charCodeAt(7);jspb.utils.split64Low=b+(c<<8)+(d<<16)+(e<<24)>>>0;jspb.utils.split64High=f+(g<<8)+(h<<16)+(a<<24)>>>0};jspb.utils.joinUint64=function(a,b){return b*jspb.BinaryConstants.TWO_TO_32+a}; +jspb.utils.joinInt64=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinZigzag64=function(a,b){var c=a&1;a=(a>>>1|b<<31)>>>0;b>>>=1;c&&(a=a+1>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinFloat32=function(a,b){var c=2*(a>>31)+1,d=a>>>23&255,e=a&8388607;return 255==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-149)*e:c*Math.pow(2,d-150)*(e+Math.pow(2,23))}; +jspb.utils.joinFloat64=function(a,b){var c=2*(b>>31)+1,d=b>>>20&2047,e=jspb.BinaryConstants.TWO_TO_32*(b&1048575)+a;return 2047==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-1074)*e:c*Math.pow(2,d-1075)*(e+jspb.BinaryConstants.TWO_TO_52)};jspb.utils.joinHash64=function(a,b){return String.fromCharCode(a>>>0&255,a>>>8&255,a>>>16&255,a>>>24&255,b>>>0&255,b>>>8&255,b>>>16&255,b>>>24&255)};jspb.utils.DIGITS="0123456789abcdef".split(""); +jspb.utils.joinUnsignedDecimalString=function(a,b){function c(a){for(var b=1E7,c=0;7>c;c++){var b=b/10,d=a/b%10>>>0;if(0!=d||h)h=!0,k+=g[d]}}if(2097151>=b)return""+(jspb.BinaryConstants.TWO_TO_32*b+a);var d=(a>>>24|b<<8)>>>0&16777215,e=b>>16&65535,f=(a&16777215)+6777216*d+6710656*e,d=d+8147497*e,e=2*e;1E7<=f&&(d+=Math.floor(f/1E7),f%=1E7);1E7<=d&&(e+=Math.floor(d/1E7),d%=1E7);var g=jspb.utils.DIGITS,h=!1,k="";(e||h)&&c(e);(d||h)&&c(d);(f||h)&&c(f);return k}; +jspb.utils.joinSignedDecimalString=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b+(0==a?1:0)>>>0);var d=jspb.utils.joinUnsignedDecimalString(a,b);return c?"-"+d:d};jspb.utils.hash64ToDecimalString=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinSignedDecimalString(c,d):jspb.utils.joinUnsignedDecimalString(c,d)}; +jspb.utils.hash64ArrayToDecimalStrings=function(a,b){for(var c=Array(a.length),d=0;dc&&(1!==a||0>>8}}function c(){for(var a=0;8>a;a++)e[a]=~e[a]&255}goog.asserts.assert(0c;c++){var d=a.charCodeAt(7-c);b[2*c+2]=jspb.utils.DIGITS[d>>4];b[2*c+3]=jspb.utils.DIGITS[d&15]}return b.join("")};jspb.utils.hexStringToHash64=function(a){a=a.toLowerCase();goog.asserts.assert(18==a.length);goog.asserts.assert("0"==a[0]);goog.asserts.assert("x"==a[1]);for(var b="",c=0;8>c;c++)var d=jspb.utils.DIGITS.indexOf(a[2*c+2]),e=jspb.utils.DIGITS.indexOf(a[2*c+3]),b=String.fromCharCode(16*d+e)+b;return b}; +jspb.utils.hash64ToNumber=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinInt64(c,d):jspb.utils.joinUint64(c,d)};jspb.utils.numberToHash64=function(a){jspb.utils.splitInt64(a);return jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.utils.countVarints=function(a,b,c){for(var d=0,e=b;e>7;return c-b-d}; +jspb.utils.countVarintFields=function(a,b,c,d){var e=0;d=8*d+jspb.BinaryConstants.WireType.VARINT;if(128>d)for(;b>=7}if(a[b++]!=f)break;for(e++;f=a[b++],0!=(f&128););}return e};jspb.utils.countFixedFields_=function(a,b,c,d,e){var f=0;if(128>d)for(;b>=7}if(a[b++]!=g)break;f++;b+=e}return f}; +jspb.utils.countFixed32Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED32,4)};jspb.utils.countFixed64Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED64,8)}; +jspb.utils.countDelimitedFields=function(a,b,c,d){var e=0;for(d=8*d+jspb.BinaryConstants.WireType.DELIMITED;b>=7}if(a[b++]!=f)break;e++;for(var g=0,h=1;f=a[b++],g+=(f&127)*h,h*=128,0!=(f&128););b+=g}return e};jspb.utils.debugBytesToTextFormat=function(a){var b='"';if(a){a=jspb.utils.byteSourceToUint8Array(a);for(var c=0;ca[c]&&(b+="0"),b+=a[c].toString(16)}return b+'"'}; +jspb.utils.debugScalarToTextFormat=function(a){return goog.isString(a)?goog.string.quote(a):a.toString()};jspb.utils.stringToByteArray=function(a){for(var b=new Uint8Array(a.length),c=0;cjspb.BinaryIterator.instanceCache_.length&&jspb.BinaryIterator.instanceCache_.push(this)}; +jspb.BinaryIterator.prototype.clear=function(){this.decoder_&&this.decoder_.free();this.elements_=this.nextMethod_=this.decoder_=null;this.cursor_=0;this.nextValue_=null;this.atEnd_=!0};jspb.BinaryIterator.prototype.get=function(){return this.nextValue_};jspb.BinaryIterator.prototype.atEnd=function(){return this.atEnd_}; +jspb.BinaryIterator.prototype.next=function(){var a=this.nextValue_;this.decoder_?this.decoder_.atEnd()?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.nextMethod_.call(this.decoder_):this.elements_&&(this.cursor_==this.elements_.length?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.elements_[this.cursor_++]);return a};jspb.BinaryDecoder=function(a,b,c){this.bytes_=null;this.tempHigh_=this.tempLow_=this.cursor_=this.end_=this.start_=0;this.error_=!1;a&&this.setBlock(a,b,c)}; +jspb.BinaryDecoder.instanceCache_=[];jspb.BinaryDecoder.alloc=function(a,b,c){if(jspb.BinaryDecoder.instanceCache_.length){var d=jspb.BinaryDecoder.instanceCache_.pop();a&&d.setBlock(a,b,c);return d}return new jspb.BinaryDecoder(a,b,c)};jspb.BinaryDecoder.prototype.free=function(){this.clear();100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)};jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)}; +jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null;this.cursor_=this.end_=this.start_=0;this.error_=!1};jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_};jspb.BinaryDecoder.prototype.setBlock=function(a,b,c){this.bytes_=jspb.utils.byteSourceToUint8Array(a);this.start_=goog.isDef(b)?b:0;this.end_=goog.isDef(c)?this.start_+c:this.bytes_.length;this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_}; +jspb.BinaryDecoder.prototype.setEnd=function(a){this.end_=a};jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_};jspb.BinaryDecoder.prototype.setCursor=function(a){this.cursor_=a};jspb.BinaryDecoder.prototype.advance=function(a){this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_)};jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_}; +jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_};jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_}; +jspb.BinaryDecoder.prototype.readSplitVarint64_=function(){for(var a,b=0,c,d=0;4>d;d++)if(a=this.bytes_[this.cursor_++],b|=(a&127)<<7*d,128>a){this.tempLow_=b>>>0;this.tempHigh_=0;return}a=this.bytes_[this.cursor_++];b|=(a&127)<<28;c=0|(a&127)>>4;if(128>a)this.tempLow_=b>>>0,this.tempHigh_=c>>>0;else{for(d=0;5>d;d++)if(a=this.bytes_[this.cursor_++],c|=(a&127)<<7*d+3,128>a){this.tempLow_=b>>>0;this.tempHigh_=c>>>0;return}goog.asserts.fail("Failed to read varint, encoding is invalid.");this.error_= +!0}};jspb.BinaryDecoder.prototype.skipVarint=function(){for(;this.bytes_[this.cursor_]&128;)this.cursor_++;this.cursor_++};jspb.BinaryDecoder.prototype.unskipVarint=function(a){for(;128>>=7;this.cursor_--}; +jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var a,b=this.bytes_;a=b[this.cursor_+0];var c=a&127;if(128>a)return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+1];c|=(a&127)<<7;if(128>a)return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+2];c|=(a&127)<<14;if(128>a)return this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+3];c|=(a&127)<<21;if(128>a)return this.cursor_+=4,goog.asserts.assert(this.cursor_<= +this.end_),c;a=b[this.cursor_+4];c|=(a&15)<<28;if(128>a)return this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),c>>>0;this.cursor_+=5;128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&goog.asserts.assert(!1);goog.asserts.assert(this.cursor_<=this.end_);return c};jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32;jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()}; +jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()};jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var a=this.readUnsignedVarint32();return a>>>1^-(a&1)};jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinUint64(this.tempLow_,this.tempHigh_)}; +jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinUnsignedDecimalString(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinInt64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinSignedDecimalString(this.tempLow_,this.tempHigh_)}; +jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinZigzag64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readZigzagVarint64().toString()};jspb.BinaryDecoder.prototype.readUint8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a}; +jspb.BinaryDecoder.prototype.readUint16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8};jspb.BinaryDecoder.prototype.readUint32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8|c<<16|d<<24)>>>0}; +jspb.BinaryDecoder.prototype.readUint64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUint64(a,b)};jspb.BinaryDecoder.prototype.readUint64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUnsignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readInt8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a<<24>>24}; +jspb.BinaryDecoder.prototype.readInt16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8)<<16>>16};jspb.BinaryDecoder.prototype.readInt32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8|c<<16|d<<24}; +jspb.BinaryDecoder.prototype.readInt64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinInt64(a,b)};jspb.BinaryDecoder.prototype.readInt64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinSignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readFloat=function(){var a=this.readUint32();return jspb.utils.joinFloat32(a,0)}; +jspb.BinaryDecoder.prototype.readDouble=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinFloat64(a,b)};jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]};jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()}; +jspb.BinaryDecoder.prototype.readString=function(a){var b=this.bytes_,c=this.cursor_;a=c+a;for(var d=[],e="";cf)d.push(f);else if(192>f)continue;else if(224>f){var g=b[c++];d.push((f&31)<<6|g&63)}else if(240>f){var g=b[c++],h=b[c++];d.push((f&15)<<12|(g&63)<<6|h&63)}else if(248>f){var g=b[c++],h=b[c++],k=b[c++],f=(f&7)<<18|(g&63)<<12|(h&63)<<6|k&63,f=f-65536;d.push((f>>10&1023)+55296,(f&1023)+56320)}8192<=d.length&&(e+=String.fromCharCode.apply(null,d),d.length=0)}e+=goog.crypt.byteArrayToString(d); +this.cursor_=c;return e};jspb.BinaryDecoder.prototype.readStringWithLength=function(){var a=this.readUnsignedVarint32();return this.readString(a)};jspb.BinaryDecoder.prototype.readBytes=function(a){if(0>a||this.cursor_+a>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var b=this.bytes_.subarray(this.cursor_,this.cursor_+a);this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_);return b}; +jspb.BinaryDecoder.prototype.readVarintHash64=function(){this.readSplitVarint64_();return jspb.utils.joinHash64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readFixedHash64=function(){var a=this.bytes_,b=this.cursor_,c=a[b+0],d=a[b+1],e=a[b+2],f=a[b+3],g=a[b+4],h=a[b+5],k=a[b+6],a=a[b+7];this.cursor_+=8;return String.fromCharCode(c,d,e,f,g,h,k,a)};jspb.BinaryReader=function(a,b,c){this.decoder_=jspb.BinaryDecoder.alloc(a,b,c);this.fieldCursor_=this.decoder_.getCursor();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null};jspb.BinaryReader.instanceCache_=[]; +jspb.BinaryReader.alloc=function(a,b,c){if(jspb.BinaryReader.instanceCache_.length){var d=jspb.BinaryReader.instanceCache_.pop();a&&d.decoder_.setBlock(a,b,c);return d}return new jspb.BinaryReader(a,b,c)};jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc; +jspb.BinaryReader.prototype.free=function(){this.decoder_.clear();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null;100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)};jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_};jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()}; +jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()};jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_};jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_};jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP};jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()}; +jspb.BinaryReader.prototype.setBlock=function(a,b,c){this.decoder_.setBlock(a,b,c);this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.advance=function(a){this.decoder_.advance(a)}; +jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var a=this.decoder_.readUnsignedVarint32(),b=a>>>3,a=a&7;if(a!=jspb.BinaryConstants.WireType.VARINT&&a!=jspb.BinaryConstants.WireType.FIXED32&&a!=jspb.BinaryConstants.WireType.FIXED64&&a!=jspb.BinaryConstants.WireType.DELIMITED&&a!=jspb.BinaryConstants.WireType.START_GROUP&&a!=jspb.BinaryConstants.WireType.END_GROUP)return goog.asserts.fail("Invalid wire type: %s (at position %s)", +a,this.fieldCursor_),this.error_=!0,!1;this.nextField_=b;this.nextWireType_=a;return!0};jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)};jspb.BinaryReader.prototype.skipMatchingFields=function(){var a=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==a;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()}; +jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()};jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var a=this.decoder_.readUnsignedVarint32();this.decoder_.advance(a)}}; +jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)};jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)}; +jspb.BinaryReader.prototype.skipGroup=function(){var a=this.nextField_;do{if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF");this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=a&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}while(1)}; +jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}}; +jspb.BinaryReader.prototype.registerReadCallback=function(a,b){goog.isNull(this.readCallbacks_)&&(this.readCallbacks_={});goog.asserts.assert(!this.readCallbacks_[a]);this.readCallbacks_[a]=b};jspb.BinaryReader.prototype.runReadCallback=function(a){goog.asserts.assert(!goog.isNull(this.readCallbacks_));a=this.readCallbacks_[a];goog.asserts.assert(a);return a(this)}; +jspb.BinaryReader.prototype.readAny=function(a){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(a);var b=jspb.BinaryConstants.FieldType;switch(a){case b.DOUBLE:return this.readDouble();case b.FLOAT:return this.readFloat();case b.INT64:return this.readInt64();case b.UINT64:return this.readUint64();case b.INT32:return this.readInt32();case b.FIXED64:return this.readFixed64();case b.FIXED32:return this.readFixed32();case b.BOOL:return this.readBool();case b.STRING:return this.readString(); +case b.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case b.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case b.BYTES:return this.readBytes();case b.UINT32:return this.readUint32();case b.ENUM:return this.readEnum();case b.SFIXED32:return this.readSfixed32();case b.SFIXED64:return this.readSfixed64();case b.SINT32:return this.readSint32();case b.SINT64:return this.readSint64();case b.FHASH64:return this.readFixedHash64();case b.VHASH64:return this.readVarintHash64(); +default:goog.asserts.fail("Invalid field type in readAny()")}return 0};jspb.BinaryReader.prototype.readMessage=function(a,b){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var c=this.decoder_.getEnd(),d=this.decoder_.readUnsignedVarint32(),d=this.decoder_.getCursor()+d;this.decoder_.setEnd(d);b(a,this);this.decoder_.setCursor(d);this.decoder_.setEnd(c)}; +jspb.BinaryReader.prototype.readGroup=function(a,b,c){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP);goog.asserts.assert(this.nextField_==a);c(b,this);this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)}; +jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var a=this.decoder_.readUnsignedVarint32(),b=this.decoder_.getCursor(),c=b+a,a=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),b,a);this.decoder_.setCursor(c);return a};jspb.BinaryReader.prototype.readInt32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint32()}; +jspb.BinaryReader.prototype.readInt32String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint32String()};jspb.BinaryReader.prototype.readInt64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64()};jspb.BinaryReader.prototype.readInt64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64String()}; +jspb.BinaryReader.prototype.readUint32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint32()};jspb.BinaryReader.prototype.readUint32String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint32String()};jspb.BinaryReader.prototype.readUint64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint64()}; +jspb.BinaryReader.prototype.readUint64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint64String()};jspb.BinaryReader.prototype.readSint32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint32()};jspb.BinaryReader.prototype.readSint64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint64()}; +jspb.BinaryReader.prototype.readSint64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint64String()};jspb.BinaryReader.prototype.readFixed32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readUint32()};jspb.BinaryReader.prototype.readFixed64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readUint64()}; +jspb.BinaryReader.prototype.readFixed64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readUint64String()};jspb.BinaryReader.prototype.readSfixed32=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readInt32()};jspb.BinaryReader.prototype.readSfixed32String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readInt32().toString()}; +jspb.BinaryReader.prototype.readSfixed64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readInt64()};jspb.BinaryReader.prototype.readSfixed64String=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readInt64String()};jspb.BinaryReader.prototype.readFloat=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readFloat()}; +jspb.BinaryReader.prototype.readDouble=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readDouble()};jspb.BinaryReader.prototype.readBool=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return!!this.decoder_.readUnsignedVarint32()};jspb.BinaryReader.prototype.readEnum=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64()}; +jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var a=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(a)};jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var a=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(a)}; +jspb.BinaryReader.prototype.readVarintHash64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readVarintHash64()};jspb.BinaryReader.prototype.readFixedHash64=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readFixedHash64()}; +jspb.BinaryReader.prototype.readPackedField_=function(a){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);for(var b=this.decoder_.readUnsignedVarint32(),b=this.decoder_.getCursor()+b,c=[];this.decoder_.getCursor()=a.cmp(c)&&(b=b.add(d),c=c.sub(a)),a=a.rightShift(),d=d.rightShift();return[b,c]};jspb.arith.UInt64.prototype.toString=function(){for(var a="",b=this;!b.zero();)var b=b.div(10),c=b[0],a=b[1].lo+a,b=c;""==a&&(a="0");return a}; jspb.arith.UInt64.fromString=function(a){for(var b=new jspb.arith.UInt64(0,0),c=new jspb.arith.UInt64(0,0),d=0;da[d]||"9">>0>>>0,((this.hi+a.hi&4294967295)>>>0)+(4294967296<=this.lo+a.lo?1:0)>>>0)};jspb.arith.Int64.prototype.sub=function(a){return new jspb.arith.Int64((this.lo-a.lo&4294967295)>>>0>>>0,((this.hi-a.hi&4294967295)>>>0)-(0>this.lo-a.lo?1:0)>>>0)};jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)}; -jspb.arith.Int64.prototype.toString=function(){var a=0!=(this.hi&2147483648),b=new jspb.arith.UInt64(this.lo,this.hi);a&&(b=(new jspb.arith.UInt64(0,0)).sub(b));return(a?"-":"")+b.toString()};jspb.arith.Int64.fromString=function(a){var b=0>>0;a=Math.floor((a-b)/jspb.BinaryConstants.TWO_TO_32)>>>0;jspb.utils.split64Low=b;jspb.utils.split64High=a};jspb.utils.splitInt64=function(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/jspb.BinaryConstants.TWO_TO_32);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295a;a=2*Math.abs(a);jspb.utils.splitUint64(a);a=jspb.utils.split64Low;var c=jspb.utils.split64High;b&&(0==a?0==c?c=a=4294967295:(c--,a=4294967295):a--);jspb.utils.split64Low=a;jspb.utils.split64High=c}; -jspb.utils.splitFloat32=function(a){var b=0>a?1:0;a=b?-a:a;var c;0===a?0<1/a?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648):isNaN(a)?(jspb.utils.split64High=0,jspb.utils.split64Low=2147483647):a>jspb.BinaryConstants.FLOAT32_MAX?(jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|2139095040)>>>0):a>>0):(c=Math.floor(Math.log(a)/ -Math.LN2),a*=Math.pow(2,-c),a=Math.round(a*jspb.BinaryConstants.TWO_TO_23)&8388607,jspb.utils.split64High=0,jspb.utils.split64Low=(b<<31|c+127<<23|a)>>>0)}; -jspb.utils.splitFloat64=function(a){var b=0>a?1:0;a=b?-a:a;if(0===a)jspb.utils.split64High=0<1/a?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(a))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(a>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(b<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(a>>0;jspb.utils.split64Low=c>>>0}else{var d= -Math.floor(Math.log(a)/Math.LN2);1024==d&&(d=1023);c=a*Math.pow(2,-d);a=c*jspb.BinaryConstants.TWO_TO_20&1048575;c=c*jspb.BinaryConstants.TWO_TO_52>>>0;jspb.utils.split64High=(b<<31|d+1023<<20|a)>>>0;jspb.utils.split64Low=c}}; -jspb.utils.splitHash64=function(a){var b=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=a.charCodeAt(4),g=a.charCodeAt(5),h=a.charCodeAt(6);a=a.charCodeAt(7);jspb.utils.split64Low=b+(c<<8)+(d<<16)+(e<<24)>>>0;jspb.utils.split64High=f+(g<<8)+(h<<16)+(a<<24)>>>0};jspb.utils.joinUint64=function(a,b){return b*jspb.BinaryConstants.TWO_TO_32+a}; -jspb.utils.joinInt64=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinZigzag64=function(a,b){var c=a&1;a=(a>>>1|b<<31)>>>0;b>>>=1;c&&(a=a+1>>>0,0==a&&(b=b+1>>>0));var d=jspb.utils.joinUint64(a,b);return c?-d:d};jspb.utils.joinFloat32=function(a,b){var c=2*(a>>31)+1,d=a>>>23&255,e=a&8388607;return 255==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-149)*e:c*Math.pow(2,d-150)*(e+Math.pow(2,23))}; -jspb.utils.joinFloat64=function(a,b){var c=2*(b>>31)+1,d=b>>>20&2047,e=jspb.BinaryConstants.TWO_TO_32*(b&1048575)+a;return 2047==d?e?NaN:Infinity*c:0==d?c*Math.pow(2,-1074)*e:c*Math.pow(2,d-1075)*(e+jspb.BinaryConstants.TWO_TO_52)};jspb.utils.joinHash64=function(a,b){return String.fromCharCode(a>>>0&255,a>>>8&255,a>>>16&255,a>>>24&255,b>>>0&255,b>>>8&255,b>>>16&255,b>>>24&255)};jspb.utils.DIGITS="0123456789abcdef".split(""); -jspb.utils.joinUnsignedDecimalString=function(a,b){function c(a){for(var b=1E7,c=0;7>c;c++){var b=b/10,d=a/b%10>>>0;if(0!=d||h)h=!0,k+=g[d]}}if(2097151>=b)return""+(jspb.BinaryConstants.TWO_TO_32*b+a);var d=(a>>>24|b<<8)>>>0&16777215,e=b>>16&65535,f=(a&16777215)+6777216*d+6710656*e,d=d+8147497*e,e=2*e;1E7<=f&&(d+=Math.floor(f/1E7),f%=1E7);1E7<=d&&(e+=Math.floor(d/1E7),d%=1E7);var g=jspb.utils.DIGITS,h=!1,k="";(e||h)&&c(e);(d||h)&&c(d);(f||h)&&c(f);return k}; -jspb.utils.joinSignedDecimalString=function(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b+(0==a?1:0)>>>0);var d=jspb.utils.joinUnsignedDecimalString(a,b);return c?"-"+d:d};jspb.utils.hash64ToDecimalString=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinSignedDecimalString(c,d):jspb.utils.joinUnsignedDecimalString(c,d)}; -jspb.utils.hash64ArrayToDecimalStrings=function(a,b){for(var c=Array(a.length),d=0;dc&&(1!==a||0>>8}}function c(){for(var a=0;8>a;a++)e[a]=~e[a]&255}goog.asserts.assert(0c;c++){var d=a.charCodeAt(7-c);b[2*c+2]=jspb.utils.DIGITS[d>>4];b[2*c+3]=jspb.utils.DIGITS[d&15]}return b.join("")};jspb.utils.hexStringToHash64=function(a){a=a.toLowerCase();goog.asserts.assert(18==a.length);goog.asserts.assert("0"==a[0]);goog.asserts.assert("x"==a[1]);for(var b="",c=0;8>c;c++)var d=jspb.utils.DIGITS.indexOf(a[2*c+2]),e=jspb.utils.DIGITS.indexOf(a[2*c+3]),b=String.fromCharCode(16*d+e)+b;return b}; -jspb.utils.hash64ToNumber=function(a,b){jspb.utils.splitHash64(a);var c=jspb.utils.split64Low,d=jspb.utils.split64High;return b?jspb.utils.joinInt64(c,d):jspb.utils.joinUint64(c,d)};jspb.utils.numberToHash64=function(a){jspb.utils.splitInt64(a);return jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.utils.countVarints=function(a,b,c){for(var d=0,e=b;e>7;return c-b-d}; -jspb.utils.countVarintFields=function(a,b,c,d){var e=0;d=8*d+jspb.BinaryConstants.WireType.VARINT;if(128>d)for(;b>=7}if(a[b++]!=f)break;for(e++;f=a[b++],0!=(f&128););}return e};jspb.utils.countFixedFields_=function(a,b,c,d,e){var f=0;if(128>d)for(;b>=7}if(a[b++]!=g)break;f++;b+=e}return f}; -jspb.utils.countFixed32Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED32,4)};jspb.utils.countFixed64Fields=function(a,b,c,d){return jspb.utils.countFixedFields_(a,b,c,8*d+jspb.BinaryConstants.WireType.FIXED64,8)}; -jspb.utils.countDelimitedFields=function(a,b,c,d){var e=0;for(d=8*d+jspb.BinaryConstants.WireType.DELIMITED;b>=7}if(a[b++]!=f)break;e++;for(var g=0,h=1;f=a[b++],g+=(f&127)*h,h*=128,0!=(f&128););b+=g}return e};jspb.utils.debugBytesToTextFormat=function(a){var b='"';if(a){a=jspb.utils.byteSourceToUint8Array(a);for(var c=0;ca[c]&&(b+="0"),b+=a[c].toString(16)}return b+'"'}; -jspb.utils.debugScalarToTextFormat=function(a){return goog.isString(a)?goog.string.quote(a):a.toString()};jspb.utils.stringToByteArray=function(a){for(var b=new Uint8Array(a.length),c=0;c>>7|b<<25)>>>0,b>>>=7;this.buffer_.push(a)}; jspb.BinaryEncoder.prototype.writeSplitFixed64=function(a,b){goog.asserts.assert(a==Math.floor(a));goog.asserts.assert(b==Math.floor(b));goog.asserts.assert(0<=a&&a>>=7;this.buffer_.push(a)}; @@ -691,61 +748,7 @@ jspb.BinaryWriter.prototype.writePackedSfixed32=function(a,b){if(null!=b&&b.leng jspb.BinaryWriter.prototype.writePackedSfixed64String=function(a,b){if(null!=b&&b.length){this.writeFieldHeader_(a,jspb.BinaryConstants.WireType.DELIMITED);this.encoder_.writeUnsignedVarint32(8*b.length);for(var c=0;cjspb.BinaryIterator.instanceCache_.length&&jspb.BinaryIterator.instanceCache_.push(this)}; -jspb.BinaryIterator.prototype.clear=function(){this.decoder_&&this.decoder_.free();this.elements_=this.nextMethod_=this.decoder_=null;this.cursor_=0;this.nextValue_=null;this.atEnd_=!0};jspb.BinaryIterator.prototype.get=function(){return this.nextValue_};jspb.BinaryIterator.prototype.atEnd=function(){return this.atEnd_}; -jspb.BinaryIterator.prototype.next=function(){var a=this.nextValue_;this.decoder_?this.decoder_.atEnd()?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.nextMethod_.call(this.decoder_):this.elements_&&(this.cursor_==this.elements_.length?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.elements_[this.cursor_++]);return a};jspb.BinaryDecoder=function(a,b,c){this.bytes_=null;this.tempHigh_=this.tempLow_=this.cursor_=this.end_=this.start_=0;this.error_=!1;a&&this.setBlock(a,b,c)}; -jspb.BinaryDecoder.instanceCache_=[];jspb.BinaryDecoder.alloc=function(a,b,c){if(jspb.BinaryDecoder.instanceCache_.length){var d=jspb.BinaryDecoder.instanceCache_.pop();a&&d.setBlock(a,b,c);return d}return new jspb.BinaryDecoder(a,b,c)};jspb.BinaryDecoder.prototype.free=function(){this.clear();100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)};jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)}; -jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null;this.cursor_=this.end_=this.start_=0;this.error_=!1};jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_};jspb.BinaryDecoder.prototype.setBlock=function(a,b,c){this.bytes_=jspb.utils.byteSourceToUint8Array(a);this.start_=goog.isDef(b)?b:0;this.end_=goog.isDef(c)?this.start_+c:this.bytes_.length;this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_}; -jspb.BinaryDecoder.prototype.setEnd=function(a){this.end_=a};jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_};jspb.BinaryDecoder.prototype.setCursor=function(a){this.cursor_=a};jspb.BinaryDecoder.prototype.advance=function(a){this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_)};jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_}; -jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_};jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_}; -jspb.BinaryDecoder.prototype.readSplitVarint64_=function(){for(var a,b=0,c,d=0;4>d;d++)if(a=this.bytes_[this.cursor_++],b|=(a&127)<<7*d,128>a){this.tempLow_=b>>>0;this.tempHigh_=0;return}a=this.bytes_[this.cursor_++];b|=(a&127)<<28;c=0|(a&127)>>4;if(128>a)this.tempLow_=b>>>0,this.tempHigh_=c>>>0;else{for(d=0;5>d;d++)if(a=this.bytes_[this.cursor_++],c|=(a&127)<<7*d+3,128>a){this.tempLow_=b>>>0;this.tempHigh_=c>>>0;return}goog.asserts.fail("Failed to read varint, encoding is invalid.");this.error_= -!0}};jspb.BinaryDecoder.prototype.skipVarint=function(){for(;this.bytes_[this.cursor_]&128;)this.cursor_++;this.cursor_++};jspb.BinaryDecoder.prototype.unskipVarint=function(a){for(;128>>=7;this.cursor_--}; -jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var a,b=this.bytes_;a=b[this.cursor_+0];var c=a&127;if(128>a)return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+1];c|=(a&127)<<7;if(128>a)return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+2];c|=(a&127)<<14;if(128>a)return this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),c;a=b[this.cursor_+3];c|=(a&127)<<21;if(128>a)return this.cursor_+=4,goog.asserts.assert(this.cursor_<= -this.end_),c;a=b[this.cursor_+4];c|=(a&15)<<28;if(128>a)return this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),c>>>0;this.cursor_+=5;128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&goog.asserts.assert(!1);goog.asserts.assert(this.cursor_<=this.end_);return c};jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32;jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()}; -jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()};jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var a=this.readUnsignedVarint32();return a>>>1^-(a&1)};jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinUint64(this.tempLow_,this.tempHigh_)}; -jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinUnsignedDecimalString(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinInt64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){this.readSplitVarint64_();return jspb.utils.joinSignedDecimalString(this.tempLow_,this.tempHigh_)}; -jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){this.readSplitVarint64_();return jspb.utils.joinZigzag64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readZigzagVarint64().toString()};jspb.BinaryDecoder.prototype.readUint8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a}; -jspb.BinaryDecoder.prototype.readUint16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8};jspb.BinaryDecoder.prototype.readUint32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8|c<<16|d<<24)>>>0}; -jspb.BinaryDecoder.prototype.readUint64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUint64(a,b)};jspb.BinaryDecoder.prototype.readUint64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinUnsignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readInt8=function(){var a=this.bytes_[this.cursor_+0];this.cursor_+=1;goog.asserts.assert(this.cursor_<=this.end_);return a<<24>>24}; -jspb.BinaryDecoder.prototype.readInt16=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1];this.cursor_+=2;goog.asserts.assert(this.cursor_<=this.end_);return(a<<0|b<<8)<<16>>16};jspb.BinaryDecoder.prototype.readInt32=function(){var a=this.bytes_[this.cursor_+0],b=this.bytes_[this.cursor_+1],c=this.bytes_[this.cursor_+2],d=this.bytes_[this.cursor_+3];this.cursor_+=4;goog.asserts.assert(this.cursor_<=this.end_);return a<<0|b<<8|c<<16|d<<24}; -jspb.BinaryDecoder.prototype.readInt64=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinInt64(a,b)};jspb.BinaryDecoder.prototype.readInt64String=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinSignedDecimalString(a,b)};jspb.BinaryDecoder.prototype.readFloat=function(){var a=this.readUint32();return jspb.utils.joinFloat32(a,0)}; -jspb.BinaryDecoder.prototype.readDouble=function(){var a=this.readUint32(),b=this.readUint32();return jspb.utils.joinFloat64(a,b)};jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]};jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()}; -jspb.BinaryDecoder.prototype.readString=function(a){var b=this.bytes_,c=this.cursor_;a=c+a;for(var d=[],e="";cf)d.push(f);else if(192>f)continue;else if(224>f){var g=b[c++];d.push((f&31)<<6|g&63)}else if(240>f){var g=b[c++],h=b[c++];d.push((f&15)<<12|(g&63)<<6|h&63)}else if(248>f){var g=b[c++],h=b[c++],k=b[c++],f=(f&7)<<18|(g&63)<<12|(h&63)<<6|k&63,f=f-65536;d.push((f>>10&1023)+55296,(f&1023)+56320)}8192<=d.length&&(e+=String.fromCharCode.apply(null,d),d.length=0)}e+=goog.crypt.byteArrayToString(d); -this.cursor_=c;return e};jspb.BinaryDecoder.prototype.readStringWithLength=function(){var a=this.readUnsignedVarint32();return this.readString(a)};jspb.BinaryDecoder.prototype.readBytes=function(a){if(0>a||this.cursor_+a>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var b=this.bytes_.subarray(this.cursor_,this.cursor_+a);this.cursor_+=a;goog.asserts.assert(this.cursor_<=this.end_);return b}; -jspb.BinaryDecoder.prototype.readVarintHash64=function(){this.readSplitVarint64_();return jspb.utils.joinHash64(this.tempLow_,this.tempHigh_)};jspb.BinaryDecoder.prototype.readFixedHash64=function(){var a=this.bytes_,b=this.cursor_,c=a[b+0],d=a[b+1],e=a[b+2],f=a[b+3],g=a[b+4],h=a[b+5],k=a[b+6],a=a[b+7];this.cursor_+=8;return String.fromCharCode(c,d,e,f,g,h,k,a)};jspb.BinaryReader=function(a,b,c){this.decoder_=jspb.BinaryDecoder.alloc(a,b,c);this.fieldCursor_=this.decoder_.getCursor();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null};jspb.BinaryReader.instanceCache_=[]; -jspb.BinaryReader.alloc=function(a,b,c){if(jspb.BinaryReader.instanceCache_.length){var d=jspb.BinaryReader.instanceCache_.pop();a&&d.decoder_.setBlock(a,b,c);return d}return new jspb.BinaryReader(a,b,c)};jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc; -jspb.BinaryReader.prototype.free=function(){this.decoder_.clear();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null;100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)};jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_};jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()}; -jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()};jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_};jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_};jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP};jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()}; -jspb.BinaryReader.prototype.setBlock=function(a,b,c){this.decoder_.setBlock(a,b,c);this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.advance=function(a){this.decoder_.advance(a)}; -jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var a=this.decoder_.readUnsignedVarint32(),b=a>>>3,a=a&7;if(a!=jspb.BinaryConstants.WireType.VARINT&&a!=jspb.BinaryConstants.WireType.FIXED32&&a!=jspb.BinaryConstants.WireType.FIXED64&&a!=jspb.BinaryConstants.WireType.DELIMITED&&a!=jspb.BinaryConstants.WireType.START_GROUP&&a!=jspb.BinaryConstants.WireType.END_GROUP)return goog.asserts.fail("Invalid wire type"), -this.error_=!0,!1;this.nextField_=b;this.nextWireType_=a;return!0};jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)};jspb.BinaryReader.prototype.skipMatchingFields=function(){var a=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==a;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()}; -jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()};jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var a=this.decoder_.readUnsignedVarint32();this.decoder_.advance(a)}}; -jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)};jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)}; -jspb.BinaryReader.prototype.skipGroup=function(){var a=[this.nextField_];do{if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF");this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP)a.push(this.nextField_);else if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP&&this.nextField_!=a.pop()){goog.asserts.fail("Unmatched end-group tag");this.error_=!0;break}}while(0 K_MAX_LENGTH) { - throw new RangeError('Invalid typed array length') + throw new RangeError('The value "' + length + '" is invalid for option "size"') } // Return an augmented `Uint8Array` instance var buf = new Uint8Array(length) @@ -999,8 +1001,8 @@ function Buffer (arg, encodingOrOffset, length) { // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' + throw new TypeError( + 'The "string" argument must be of type string. Received type number' ) } return allocUnsafe(arg) @@ -1009,7 +1011,7 @@ function Buffer (arg, encodingOrOffset, length) { } // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 -if (typeof Symbol !== 'undefined' && Symbol.species && +if (typeof Symbol !== 'undefined' && Symbol.species != null && Buffer[Symbol.species] === Buffer) { Object.defineProperty(Buffer, Symbol.species, { value: null, @@ -1022,19 +1024,51 @@ if (typeof Symbol !== 'undefined' && Symbol.species && Buffer.poolSize = 8192 // not used by this implementation function from (value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (isArrayBuffer(value) || (value && isArrayBuffer(value.buffer))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - if (typeof value === 'string') { return fromString(value, encodingOrOffset) } - return fromObject(value) + if (ArrayBuffer.isView(value)) { + return fromArrayLike(value) + } + + if (value == null) { + throw TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } + + var valueOf = value.valueOf && value.valueOf() + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } + + var b = fromObject(value) + if (b) return b + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from( + value[Symbol.toPrimitive]('string'), encodingOrOffset, length + ) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) } /** @@ -1058,7 +1092,7 @@ function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be of type number') } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') + throw new RangeError('The value "' + size + '" is invalid for option "size"') } } @@ -1173,20 +1207,16 @@ function fromObject (obj) { return buf } - if (obj) { - if (ArrayBuffer.isView(obj) || 'length' in obj) { - if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { - return createBuffer(0) - } - return fromArrayLike(obj) - } - - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - return fromArrayLike(obj.data) + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) } + return fromArrayLike(obj) } - throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.') + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } } function checked (length) { @@ -1207,12 +1237,17 @@ function SlowBuffer (length) { } Buffer.isBuffer = function isBuffer (b) { - return b != null && b._isBuffer === true + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false } Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError('Arguments must be Buffers') + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) } if (a === b) return 0 @@ -1273,7 +1308,7 @@ Buffer.concat = function concat (list, length) { var pos = 0 for (i = 0; i < list.length; ++i) { var buf = list[i] - if (ArrayBuffer.isView(buf)) { + if (isInstance(buf, Uint8Array)) { buf = Buffer.from(buf) } if (!Buffer.isBuffer(buf)) { @@ -1289,15 +1324,19 @@ function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } - if (ArrayBuffer.isView(string) || isArrayBuffer(string)) { + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { return string.byteLength } if (typeof string !== 'string') { - string = '' + string + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) } var len = string.length - if (len === 0) return 0 + var mustMatch = (arguments.length > 2 && arguments[2] === true) + if (!mustMatch && len === 0) return 0 // Use a for loop to avoid recursion var loweredCase = false @@ -1309,7 +1348,6 @@ function byteLength (string, encoding) { return len case 'utf8': case 'utf-8': - case undefined: return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': @@ -1321,7 +1359,9 @@ function byteLength (string, encoding) { case 'base64': return base64ToBytes(string).length default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } encoding = ('' + encoding).toLowerCase() loweredCase = true } @@ -1468,16 +1508,20 @@ Buffer.prototype.equals = function equals (b) { Buffer.prototype.inspect = function inspect () { var str = '' var max = exports.INSPECT_MAX_BYTES - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') - if (this.length > max) str += ' ... ' - } + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() + if (this.length > max) str += ' ... ' return '' } Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength) + } if (!Buffer.isBuffer(target)) { - throw new TypeError('Argument must be a Buffer') + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) } if (start === undefined) { @@ -1556,7 +1600,7 @@ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } - byteOffset = +byteOffset // Coerce to Number. + byteOffset = +byteOffset // Coerce to Number. if (numberIsNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : (buffer.length - 1) @@ -1808,8 +1852,8 @@ function utf8Slice (buf, start, end) { var codePoint = null var bytesPerSequence = (firstByte > 0xEF) ? 4 : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 + : (firstByte > 0xBF) ? 2 + : 1 if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint @@ -2472,7 +2516,7 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) { } else { var bytes = Buffer.isBuffer(val) ? val - : new Buffer(val, encoding) + : Buffer.from(val, encoding) var len = bytes.length if (len === 0) { throw new TypeError('The value "' + val + @@ -2627,19 +2671,21 @@ function blitBuffer (src, dst, offset, length) { return i } -// ArrayBuffers from another context (i.e. an iframe) do not pass the `instanceof` check -// but they should be treated as valid. See: https://github.com/feross/buffer/issues/166 -function isArrayBuffer (obj) { - return obj instanceof ArrayBuffer || - (obj != null && obj.constructor != null && obj.constructor.name === 'ArrayBuffer' && - typeof obj.byteLength === 'number') +// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass +// the `instanceof` check but they should be treated as of that type. +// See: https://github.com/feross/buffer/issues/166 +function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) } - function numberIsNaN (obj) { + // For IE11 support return obj !== obj // eslint-disable-line no-self-compare } -},{"base64-js":4,"ieee754":6}],6:[function(require,module,exports){ +}).call(this,require("buffer").Buffer) +},{"base64-js":4,"buffer":5,"ieee754":6}],6:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1