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.FieldcachedSizeFieldprivate booleanenforceUtf8private Internal.EnumVerifierenumVerifierprivate java.lang.reflect.Fieldfieldprivate intfieldNumberprivate java.lang.ObjectmapDefaultEntryprivate OneofInfooneofprivate java.lang.Class<?>oneofStoredTypeprivate java.lang.reflect.FieldpresenceFieldprivate intpresenceMaskprivate booleanrequiredprivate FieldTypetype
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldInfobuild()FieldInfo.BuilderwithCachedSizeField(java.lang.reflect.Field cachedSizeField)FieldInfo.BuilderwithEnforceUtf8(boolean enforceUtf8)FieldInfo.BuilderwithEnumVerifier(Internal.EnumVerifier enumVerifier)FieldInfo.BuilderwithField(java.lang.reflect.Field field)Specifies the actual field on the message represented by this field.FieldInfo.BuilderwithFieldNumber(int fieldNumber)Specifies the unique field number for this field within the message.FieldInfo.BuilderwithMapDefaultEntry(java.lang.Object mapDefaultEntry)FieldInfo.BuilderwithOneof(OneofInfo oneof, java.lang.Class<?> oneofStoredType)Sets the information for building a oneof member field.FieldInfo.BuilderwithPresence(java.lang.reflect.Field presenceField, int presenceMask)Specifies proto2 presence information.FieldInfo.BuilderwithRequired(boolean required)FieldInfo.BuilderwithType(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()
-
-