Package com.google.protobuf
Class FieldInfo.Builder
- java.lang.Object
-
- com.google.protobuf.FieldInfo.Builder
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Field
cachedSizeField
private boolean
enforceUtf8
private Internal.EnumVerifier
enumVerifier
private java.lang.reflect.Field
field
private int
fieldNumber
private java.lang.Object
mapDefaultEntry
private OneofInfo
oneof
private java.lang.Class<?>
oneofStoredType
private java.lang.reflect.Field
presenceField
private int
presenceMask
private boolean
required
private FieldType
type
-
Constructor Summary
Constructors Modifier Constructor Description private
Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldInfo
build()
FieldInfo.Builder
withCachedSizeField(java.lang.reflect.Field cachedSizeField)
FieldInfo.Builder
withEnforceUtf8(boolean enforceUtf8)
FieldInfo.Builder
withEnumVerifier(Internal.EnumVerifier enumVerifier)
FieldInfo.Builder
withField(java.lang.reflect.Field field)
Specifies the actual field on the message represented by this field.FieldInfo.Builder
withFieldNumber(int fieldNumber)
Specifies the unique field number for this field within the message.FieldInfo.Builder
withMapDefaultEntry(java.lang.Object mapDefaultEntry)
FieldInfo.Builder
withOneof(OneofInfo oneof, java.lang.Class<?> oneofStoredType)
Sets the information for building a oneof member field.FieldInfo.Builder
withPresence(java.lang.reflect.Field presenceField, int presenceMask)
Specifies proto2 presence information.FieldInfo.Builder
withRequired(boolean required)
FieldInfo.Builder
withType(FieldType type)
Specifies the type of this field.
-
-
-
Field Detail
-
field
private java.lang.reflect.Field field
-
type
private FieldType type
-
fieldNumber
private int fieldNumber
-
presenceField
private java.lang.reflect.Field presenceField
-
presenceMask
private int presenceMask
-
required
private boolean required
-
enforceUtf8
private boolean enforceUtf8
-
oneof
private OneofInfo oneof
-
oneofStoredType
private java.lang.Class<?> oneofStoredType
-
mapDefaultEntry
private java.lang.Object mapDefaultEntry
-
enumVerifier
private Internal.EnumVerifier enumVerifier
-
cachedSizeField
private java.lang.reflect.Field cachedSizeField
-
-
Method Detail
-
withField
public FieldInfo.Builder withField(java.lang.reflect.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(java.lang.reflect.Field presenceField, int presenceMask)
Specifies proto2 presence information. This should not be called for oneof fields.
-
withOneof
public FieldInfo.Builder withOneof(OneofInfo oneof, java.lang.Class<?> oneofStoredType)
Sets the information for building a oneof member field. This is incompatible withwithField(Field)
andwithPresence(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 anObject
, primitives will store their boxed type.
-
withRequired
public FieldInfo.Builder withRequired(boolean required)
-
withMapDefaultEntry
public FieldInfo.Builder withMapDefaultEntry(java.lang.Object mapDefaultEntry)
-
withEnforceUtf8
public FieldInfo.Builder withEnforceUtf8(boolean enforceUtf8)
-
withEnumVerifier
public FieldInfo.Builder withEnumVerifier(Internal.EnumVerifier enumVerifier)
-
withCachedSizeField
public FieldInfo.Builder withCachedSizeField(java.lang.reflect.Field cachedSizeField)
-
build
public FieldInfo build()
-
-