當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。