Package com.google.protobuf
Class UnknownFieldSet.Field
java.lang.Object
com.google.protobuf.UnknownFieldSet.Field
- Enclosing class:
- UnknownFieldSet
Represents a single field in an
UnknownFieldSet.
A Field consists of five lists of values. The lists correspond to the five "wire
types" used in the protocol buffer binary format. The wire type of each field can be determined
from the encoded form alone, without knowing the field's declared type. So, we are able to
parse unknown values at least this far and separate them. Normally, only one of the five lists
will contain any values, since it is impossible to define a valid message type that declares
two different types for the same field number. However, the code is designed to allow for the
case where the same unknown field number is encountered using multiple different wire types.
Field is an immutable class. To construct one, you must use a UnknownFieldSet.Field.Builder.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classUsed to build aUnknownFieldSet.Fieldwithin anUnknownFieldSet. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final UnknownFieldSet.Fieldprivate List<UnknownFieldSet>private List<ByteString> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic UnknownFieldSet.FieldGet an emptyField.Get the list of fixed32 values for this field.Get the list of fixed64 values for this field.Get the list of embedded group values for this field.private Object[]Returns the array of objects to be used to uniquely identify thisUnknownFieldSet.Fieldinstance.Get the list of length-delimited values for this field.intgetSerializedSize(int fieldNumber) Get the number of bytes required to encode this field, including field number.intgetSerializedSizeAsMessageSetExtension(int fieldNumber) Get the number of bytes required to encode this field, including field number, usingMessageSetwire format.Get the list of varint values for this field.inthashCode()Construct a newUnknownFieldSet.Field.Builder.newBuilder(UnknownFieldSet.Field copyFrom) Construct a newUnknownFieldSet.Field.Builderand initialize it to a copy ofcopyFrom.toByteString(int fieldNumber) Serializes the message to aByteStringand returns it.voidwriteAsMessageSetExtensionTo(int fieldNumber, CodedOutputStream output) Serializes the field, including field number, and writes it tooutput, usingMessageSetwire format.private voidwriteAsMessageSetExtensionTo(int fieldNumber, Writer writer) Serializes the field, including field number, and writes it towriter, usingMessageSetwire format.voidwriteTo(int fieldNumber, CodedOutputStream output) Serializes the field, including field number, and writes it tooutput.(package private) voidSerializes the field, including field number, and writes it towriter.
-
Field Details
-
fieldDefaultInstance
-
varint
-
fixed32
-
fixed64
-
lengthDelimited
-
group
-
-
Constructor Details
-
Field
private Field()
-
-
Method Details
-
newBuilder
Construct a newUnknownFieldSet.Field.Builder. -
newBuilder
Construct a newUnknownFieldSet.Field.Builderand initialize it to a copy ofcopyFrom. -
getDefaultInstance
Get an emptyField. -
getVarintList
Get the list of varint values for this field. -
getFixed32List
Get the list of fixed32 values for this field. -
getFixed64List
Get the list of fixed64 values for this field. -
getLengthDelimitedList
Get the list of length-delimited values for this field. -
getGroupList
Get the list of embedded group values for this field. These are represented usingUnknownFieldSets rather thanMessages since the group's type is presumably unknown. -
equals
-
hashCode
public int hashCode() -
getIdentityArray
Returns the array of objects to be used to uniquely identify thisUnknownFieldSet.Fieldinstance. -
toByteString
Serializes the message to aByteStringand returns it. This is just a trivial wrapper aroundwriteTo(int, CodedOutputStream). -
writeTo
Serializes the field, including field number, and writes it tooutput.- Throws:
IOException
-
getSerializedSize
public int getSerializedSize(int fieldNumber) Get the number of bytes required to encode this field, including field number. -
writeAsMessageSetExtensionTo
public void writeAsMessageSetExtensionTo(int fieldNumber, CodedOutputStream output) throws IOException Serializes the field, including field number, and writes it tooutput, usingMessageSetwire format.- Throws:
IOException
-
writeTo
Serializes the field, including field number, and writes it towriter.- Throws:
IOException
-
writeAsMessageSetExtensionTo
Serializes the field, including field number, and writes it towriter, usingMessageSetwire format.- Throws:
IOException
-
getSerializedSizeAsMessageSetExtension
public int getSerializedSizeAsMessageSetExtension(int fieldNumber) Get the number of bytes required to encode this field, including field number, usingMessageSetwire format.
-