Package com.google.protobuf
Class UnknownFieldSet.Field
- java.lang.Object
-
- com.google.protobuf.UnknownFieldSet.Field
-
- Enclosing class:
- UnknownFieldSet
public static final class UnknownFieldSet.Field extends java.lang.ObjectRepresents a single field in anUnknownFieldSet.A
Fieldconsists 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.Fieldis an immutable class. To construct one, you must use aUnknownFieldSet.Field.Builder.- See Also:
UnknownFieldSet
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUnknownFieldSet.Field.BuilderUsed to build aUnknownFieldSet.Fieldwithin anUnknownFieldSet.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)static UnknownFieldSet.FieldgetDefaultInstance()Get an emptyField.java.util.List<java.lang.Integer>getFixed32List()Get the list of fixed32 values for this field.java.util.List<java.lang.Long>getFixed64List()Get the list of fixed64 values for this field.java.util.List<UnknownFieldSet>getGroupList()Get the list of embedded group values for this field.java.util.List<ByteString>getLengthDelimitedList()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.java.util.List<java.lang.Long>getVarintList()Get the list of varint values for this field.inthashCode()static UnknownFieldSet.Field.BuildernewBuilder()Construct a newUnknownFieldSet.Field.Builder.static UnknownFieldSet.Field.BuildernewBuilder(UnknownFieldSet.Field copyFrom)Construct a newUnknownFieldSet.Field.Builderand initialize it to a copy ofcopyFrom.ByteStringtoByteString(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.voidwriteTo(int fieldNumber, CodedOutputStream output)Serializes the field, including field number, and writes it tooutput.
-
-
-
Method Detail
-
newBuilder
public static UnknownFieldSet.Field.Builder newBuilder()
Construct a newUnknownFieldSet.Field.Builder.
-
newBuilder
public static UnknownFieldSet.Field.Builder newBuilder(UnknownFieldSet.Field copyFrom)
Construct a newUnknownFieldSet.Field.Builderand initialize it to a copy ofcopyFrom.
-
getDefaultInstance
public static UnknownFieldSet.Field getDefaultInstance()
Get an emptyField.
-
getVarintList
public java.util.List<java.lang.Long> getVarintList()
Get the list of varint values for this field.
-
getFixed32List
public java.util.List<java.lang.Integer> getFixed32List()
Get the list of fixed32 values for this field.
-
getFixed64List
public java.util.List<java.lang.Long> getFixed64List()
Get the list of fixed64 values for this field.
-
getLengthDelimitedList
public java.util.List<ByteString> getLengthDelimitedList()
Get the list of length-delimited values for this field.
-
getGroupList
public java.util.List<UnknownFieldSet> 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
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toByteString
public ByteString toByteString(int fieldNumber)
Serializes the message to aByteStringand returns it. This is just a trivial wrapper aroundwriteTo(int, CodedOutputStream).
-
writeTo
public void writeTo(int fieldNumber, CodedOutputStream output) throws java.io.IOExceptionSerializes the field, including field number, and writes it tooutput.- Throws:
java.io.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 java.io.IOExceptionSerializes the field, including field number, and writes it tooutput, usingMessageSetwire format.- Throws:
java.io.IOException
-
getSerializedSizeAsMessageSetExtension
public int getSerializedSizeAsMessageSetExtension(int fieldNumber)
Get the number of bytes required to encode this field, including field number, usingMessageSetwire format.
-
-