当前位置: 首页>>代码示例>>Java>>正文


Java ClientToServerMessage.hasRegistrationMessage方法代码示例

本文整理汇总了Java中com.google.protos.ipc.invalidation.ClientProtocol.ClientToServerMessage.hasRegistrationMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ClientToServerMessage.hasRegistrationMessage方法的具体用法?Java ClientToServerMessage.hasRegistrationMessage怎么用?Java ClientToServerMessage.hasRegistrationMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.protos.ipc.invalidation.ClientProtocol.ClientToServerMessage的用法示例。


在下文中一共展示了ClientToServerMessage.hasRegistrationMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hasField

import com.google.protos.ipc.invalidation.ClientProtocol.ClientToServerMessage; //导入方法依赖的package包/类
/** Returns whether {@code field} is present in {@code message}. */
@Override
@SuppressWarnings("unchecked")
public boolean hasField(MessageLite rawMessage, Descriptor field) {
  Preconditions.checkNotNull(rawMessage);
  Preconditions.checkNotNull(field);
  ClientToServerMessage message = (ClientToServerMessage) rawMessage;
  if (field == HEADER) {
    return message.hasHeader();
  }
  if (field == INITIALIZE_MESSAGE) {
    return message.hasInitializeMessage();
  }
  if (field == REGISTRATION_MESSAGE) {
    return message.hasRegistrationMessage();
  }
  if (field == REGISTRATION_SYNC_MESSAGE) {
    return message.hasRegistrationSyncMessage();
  }
  if (field == INVALIDATION_ACK_MESSAGE) {
    return message.hasInvalidationAckMessage();
  }
  if (field == INFO_MESSAGE) {
    return message.hasInfoMessage();
  }
  throw new IllegalArgumentException("Bad descriptor: " + field);
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:28,代码来源:ClientProtocolAccessor.java

示例2: toCompactString

import com.google.protos.ipc.invalidation.ClientProtocol.ClientToServerMessage; //导入方法依赖的package包/类
/**
 * If {@code printHighFrequencyMessages} is true, logs sub-messages that are exchanged at a high
 * frequency between the client and the registrar, e.g., invalidation ack message, heartbeat
 * message.
 */
public static TextBuilder toCompactString(TextBuilder builder,
    ClientToServerMessage msg, boolean printHighFrequencyMessages) {
  // Print the header and any sub-messages in the message.

  toCompactString(builder, msg.getHeader());
  builder.append(',');

  if (msg.hasInitializeMessage()) {
    toCompactString(builder, msg.getInitializeMessage());
    builder.append(',');
  }
  if (msg.hasRegistrationMessage()) {
    toCompactString(builder, msg.getRegistrationMessage());
    builder.append(',');
  }
  if (msg.hasRegistrationSyncMessage()) {
    toCompactString(builder, msg.getRegistrationSyncMessage());
    builder.append(',');
  }
  if (printHighFrequencyMessages && msg.hasInvalidationAckMessage()) {
    toCompactString(builder, msg.getInvalidationAckMessage());
    builder.append(',');
  }
  if (printHighFrequencyMessages && msg.hasInfoMessage()) {
    toCompactString(builder, msg.getInfoMessage());
    builder.append(',');
  }
  return builder;
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:35,代码来源:CommonProtoStrings2.java


注:本文中的com.google.protos.ipc.invalidation.ClientProtocol.ClientToServerMessage.hasRegistrationMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。