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


Java Version类代码示例

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


Version类属于com.google.protos.ipc.invalidation.ClientProtocol包,在下文中一共展示了Version类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: postValidate

import com.google.protos.ipc.invalidation.ClientProtocol.Version; //导入依赖的package包/类
@Override
public boolean postValidate(MessageLite message) {
  // Versions must be non-negative.
  Version version = (Version) message;
  if ((version.getMajorVersion() < 0) || (version.getMinorVersion() < 0)) {
    return false;
  }
  return true;
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:10,代码来源:AndroidIntentProtocolValidator.java

示例2: hasField

import com.google.protos.ipc.invalidation.ClientProtocol.Version; //导入依赖的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);
  Version message = (Version) rawMessage;
  if (field == MAJOR_VERSION) {
    return message.hasMajorVersion();
  }
  if (field == MINOR_VERSION) {
    return message.hasMinorVersion();
  }
  throw new IllegalArgumentException("Bad descriptor: " + field);
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:16,代码来源:ClientProtocolAccessor.java

示例3: getField

import com.google.protos.ipc.invalidation.ClientProtocol.Version; //导入依赖的package包/类
/** Returns the {@code field} from {@code message}. */
@Override
@SuppressWarnings("unchecked")
public Object getField(MessageLite rawMessage, Descriptor field) {
  Preconditions.checkNotNull(rawMessage);
  Preconditions.checkNotNull(field);
  Version message = (Version) rawMessage;
  if (field == MAJOR_VERSION) {
    return message.getMajorVersion();
  }
  if (field == MINOR_VERSION) {
    return message.getMinorVersion();
  }
  throw new IllegalArgumentException("Bad descriptor: " + field);
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:16,代码来源:ClientProtocolAccessor.java

示例4: newAndroidEndpointId

import com.google.protos.ipc.invalidation.ClientProtocol.Version; //导入依赖的package包/类
/**
 * Constructs a network endpoint id for an Android client with the given {@code registrationId},
 * {@code clientKey}, and {@code packageName}.
 */
public static NetworkEndpointId newAndroidEndpointId(String registrationId, String clientKey,
    String packageName, Version channelVersion) {
  Preconditions.checkNotNull(registrationId, "Null registration id");
  Preconditions.checkNotNull(clientKey, "Null client key");
  Preconditions.checkNotNull(packageName, "Null package name");
  Preconditions.checkNotNull(channelVersion, "Null channel version");

  AndroidChannel.EndpointId.Builder endpointBuilder = AndroidChannel.EndpointId.newBuilder()
      .setC2DmRegistrationId(registrationId)
      .setClientKey(clientKey)
      .setPackageName(packageName)
      .setChannelVersion(channelVersion);
  return newNetworkEndpointId(NetworkAddress.ANDROID, endpointBuilder.build().toByteString());
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:19,代码来源:CommonProtos2.java

示例5: postValidate

import com.google.protos.ipc.invalidation.ClientProtocol.Version; //导入依赖的package包/类
@Override
public boolean postValidate(MessageLite message) {
  // Versions must be non-negative.
  Version version = (Version) message;
  if ((version.getMajorVersion() < 0) || (version.getMinorVersion() < 0)) {
    logger.info("Invalid versions: %s", version);
    return false;
  }
  return true;
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:11,代码来源:TiclMessageValidator2.java

示例6: newVersion

import com.google.protos.ipc.invalidation.ClientProtocol.Version; //导入依赖的package包/类
public static Version newVersion(int majorVersion, int minorVersion) {
  return Version.newBuilder().setMajorVersion(majorVersion).setMinorVersion(minorVersion).build();
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:4,代码来源:CommonProtos2.java

示例7: isValid

import com.google.protos.ipc.invalidation.ClientProtocol.Version; //导入依赖的package包/类
/** Returns whether {@code version} is valid. */
public boolean isValid(Version version) {
  return checkMessage(version, commonMsgInfos.VERSION);
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:5,代码来源:TiclMessageValidator2.java


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