Class FieldInfo.Builder

java.lang.Object
com.google.protobuf.FieldInfo.Builder
Enclosing class:
FieldInfo

public static final class FieldInfo.Builder extends Object
A builder for FieldInfo instances.
  • Field Details

    • field

      private Field field
    • type

      private FieldType type
    • fieldNumber

      private int fieldNumber
    • presenceField

      private Field presenceField
    • presenceMask

      private int presenceMask
    • required

      private boolean required
    • enforceUtf8

      private boolean enforceUtf8
    • oneof

      private OneofInfo oneof
    • oneofStoredType

      private Class<?> oneofStoredType
    • mapDefaultEntry

      private Object mapDefaultEntry
    • enumVerifier

      private Internal.EnumVerifier enumVerifier
    • cachedSizeField

      private Field cachedSizeField
  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • withField

      public FieldInfo.Builder withField(Field field)
      Specifies the actual field on the message represented by this field. This should not be called for oneof member fields.
    • withType

      public FieldInfo.Builder withType(FieldType type)
      Specifies the type of this field.
    • withFieldNumber

      public FieldInfo.Builder withFieldNumber(int fieldNumber)
      Specifies the unique field number for this field within the message.
    • withPresence

      public FieldInfo.Builder withPresence(Field presenceField, int presenceMask)
      Specifies proto2 presence information. This should not be called for oneof fields.
    • withOneof

      public FieldInfo.Builder withOneof(OneofInfo oneof, Class<?> oneofStoredType)
      Sets the information for building a oneof member field. This is incompatible with withField(Field) and withPresence(Field, int).
      Parameters:
      oneof - the oneof for which this field is associated.
      oneofStoredType - the actual type stored in the oneof value for this field. Since the oneof value is an Object, primitives will store their boxed type.
    • withRequired

      public FieldInfo.Builder withRequired(boolean required)
    • withMapDefaultEntry

      public FieldInfo.Builder withMapDefaultEntry(Object mapDefaultEntry)
    • withEnforceUtf8

      public FieldInfo.Builder withEnforceUtf8(boolean enforceUtf8)
    • withEnumVerifier

      public FieldInfo.Builder withEnumVerifier(Internal.EnumVerifier enumVerifier)
    • withCachedSizeField

      public FieldInfo.Builder withCachedSizeField(Field cachedSizeField)
    • build

      public FieldInfo build()