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


Java FieldType类代码示例

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


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

示例1: newSingularGeneratedExtension

import com.google.protobuf.WireFormat.FieldType; //导入依赖的package包/类
/** For use by generated code only. */
public static <ContainingType extends MessageLite, Type>
    GeneratedExtension<ContainingType, Type>
        newSingularGeneratedExtension(
            final ContainingType containingTypeDefaultInstance,
            final Type defaultValue,
            final MessageLite messageDefaultInstance,
            final Internal.EnumLiteMap<?> enumTypeMap,
            final int number,
            final WireFormat.FieldType type,
            final Class singularType) {
  return new GeneratedExtension<ContainingType, Type>(
      containingTypeDefaultInstance,
      defaultValue,
      messageDefaultInstance,
      new ExtensionDescriptor(enumTypeMap, number, type,
                              false /* isRepeated */,
                              false /* isPacked */),
      singularType);
}
 
开发者ID:reubenbrown13,项目名称:cfapi,代码行数:21,代码来源:GeneratedMessageLite.java

示例2: newRepeatedGeneratedExtension

import com.google.protobuf.WireFormat.FieldType; //导入依赖的package包/类
/** For use by generated code only. */
public static <ContainingType extends MessageLite, Type>
    GeneratedExtension<ContainingType, Type>
        newRepeatedGeneratedExtension(
            final ContainingType containingTypeDefaultInstance,
            final MessageLite messageDefaultInstance,
            final Internal.EnumLiteMap<?> enumTypeMap,
            final int number,
            final WireFormat.FieldType type,
            final boolean isPacked,
            final Class singularType) {
  @SuppressWarnings("unchecked")  // Subclasses ensure Type is a List
  Type emptyList = (Type) Collections.emptyList();
  return new GeneratedExtension<ContainingType, Type>(
      containingTypeDefaultInstance,
      emptyList,
      messageDefaultInstance,
      new ExtensionDescriptor(
          enumTypeMap, number, type, true /* isRepeated */, isPacked),
      singularType);
}
 
开发者ID:reubenbrown13,项目名称:cfapi,代码行数:22,代码来源:GeneratedMessageLite.java

示例3: GeneratedExtension

import com.google.protobuf.WireFormat.FieldType; //导入依赖的package包/类
/**
 * Create a new instance with the given parameters.
 *
 * The last parameter {@code singularType} is only needed for enum types.
 * We store integer values for enum types in a {@link ExtendableMessage}
 * and use Java reflection to convert an integer value back into a concrete
 * enum object.
 */
GeneratedExtension(
    final ContainingType containingTypeDefaultInstance,
    final Type defaultValue,
    final MessageLite messageDefaultInstance,
    final ExtensionDescriptor descriptor,
    final Class singularType) {
  // Defensive checks to verify the correct initialization order of
  // GeneratedExtensions and their related GeneratedMessages.
  if (containingTypeDefaultInstance == null) {
    throw new IllegalArgumentException(
        "Null containingTypeDefaultInstance");
  }
  if (descriptor.getLiteType() == WireFormat.FieldType.MESSAGE &&
      messageDefaultInstance == null) {
    throw new IllegalArgumentException(
        "Null messageDefaultInstance");
  }
  this.containingTypeDefaultInstance = containingTypeDefaultInstance;
  this.defaultValue = defaultValue;
  this.messageDefaultInstance = messageDefaultInstance;
  this.descriptor = descriptor;
}
 
开发者ID:reubenbrown13,项目名称:cfapi,代码行数:31,代码来源:GeneratedMessageLite.java

示例4: ExtensionDescriptor

import com.google.protobuf.WireFormat.FieldType; //导入依赖的package包/类
ExtensionDescriptor(
    final Internal.EnumLiteMap<?> enumTypeMap,
    final int number,
    final WireFormat.FieldType type,
    final boolean isRepeated,
    final boolean isPacked) {
  this.enumTypeMap = enumTypeMap;
  this.number = number;
  this.type = type;
  this.isRepeated = isRepeated;
  this.isPacked = isPacked;
}
 
开发者ID:reubenbrown13,项目名称:cfapi,代码行数:13,代码来源:GeneratedMessageLite.java

示例5: getLiteType

import com.google.protobuf.WireFormat.FieldType; //导入依赖的package包/类
public WireFormat.FieldType getLiteType() {
  return type;
}
 
开发者ID:reubenbrown13,项目名称:cfapi,代码行数:4,代码来源:GeneratedMessageLite.java

示例6: getLiteType

import com.google.protobuf.WireFormat.FieldType; //导入依赖的package包/类
@Override
public WireFormat.FieldType getLiteType() {
  return type;
}
 
开发者ID:yeriomin,项目名称:play-store-api,代码行数:5,代码来源:GeneratedMessageLite.java


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