Top Description Inners Fields Constructors Methods
com.google.protobuf

public final Class UnknownFieldSet

extends Object
implements MessageLite
Class Inheritance
All Implemented Interfaces
com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder
Imports
com.google.protobuf.AbstractMessageLite.Builder.LimitedInputStream, java.io.IOException, .InputStream, .OutputStream, java.util.ArrayList, .Arrays, .Collections, .List, .ListIterator, .Map, .TreeMap

UnknownFieldSet is used to keep track of fields which were seen when parsing a protocol message but whose field numbers or types are unrecognized. This most frequently occurs when new fields are added to a message type and then messages containing those fields are read by old software that was compiled before the new types were added.

Every Message contains an UnknownFieldSet (and every Message.Builder contains an Builder).

Most users will never need to use this class.

Author
[email protected] Kenton Varda

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
UnknownFieldSet.Field

Represents a single field in an UnknownFieldSet.

public static class
UnknownFieldSet.Parser

Parser to implement MessageLite interface.

Field Summary

Modifier and TypeField and Description
private static final UnknownFieldSet
private final Map<Integer, UnknownFieldSet.Field>
private static final UnknownFieldSet.Parser

Constructor Summary

AccessConstructor and Description
private
pack-priv
UnknownFieldSet(final Map<Integer, UnknownFieldSet.Field> fields, final Map<Integer, UnknownFieldSet.Field> fieldsDescending)

Construct an UnknownFieldSet around the given map.

Method Summary

Modifier and TypeMethod and Description
public Map<Integer, UnknownFieldSet.Field>
asMap()

Get a map of fields in the set by number.

public boolean
equals(final Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public static UnknownFieldSet
getDefaultInstance()

Get an empty UnknownFieldSet.

public UnknownFieldSet
getDefaultInstanceForType()

Implements com.google.protobuf.MessageLiteOrBuilder.getDefaultInstanceForType.

Get an instance of the type with no fields set.
public UnknownFieldSet.Field
getField(final int number)

Get a field by number.

public final UnknownFieldSet.Parser
getParserForType()

Implements com.google.protobuf.MessageLite.getParserForType.

Gets the parser for a message of the same type as this message.
public int
getSerializedSize()

Implements com.google.protobuf.MessageLite.getSerializedSize.

Get the number of bytes required to encode this set.
public int
getSerializedSizeAsMessageSet()

Get the number of bytes required to encode this set using MessageSet wire format.

public boolean
hasField(final int number)

Check if the given field number is present in the set.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
isInitialized()

Implements com.google.protobuf.MessageLiteOrBuilder.isInitialized.

Returns true if all required fields in the message and all embedded messages are set, false otherwise.
public static UnknownFieldSet.Builder
newBuilder()

Create a new Builder.

public static UnknownFieldSet.Builder
newBuilder(final UnknownFieldSet copyFrom)

Create a new Builder and initialize it to be a copy of copyFrom.

public UnknownFieldSet.Builder
newBuilderForType()

Implements com.google.protobuf.MessageLite.newBuilderForType.

Constructs a new builder for a message of the same type as this message.
public static UnknownFieldSet
parseFrom(final CodedInputStream input)

Parse an UnknownFieldSet from the given input stream.

public static UnknownFieldSet
parseFrom(final ByteString data)

Parse data as an UnknownFieldSet and return it.

public static UnknownFieldSet
parseFrom(final byte[] data)

Parse data as an UnknownFieldSet and return it.

public static UnknownFieldSet
parseFrom(final InputStream input)

Parse an UnknownFieldSet from input and return it.

public UnknownFieldSet.Builder
toBuilder()

Implements com.google.protobuf.MessageLite.toBuilder.

Constructs a builder initialized with the current message.
public byte[]
toByteArray()

Implements com.google.protobuf.MessageLite.toByteArray.

Serializes the message to a byte array and returns it.
public ByteString
toByteString()

Implements com.google.protobuf.MessageLite.toByteString.

Serializes the message to a ByteString and returns it.
public String
toString()

Overrides java.lang.Object.toString.

Converts the set to a string in protocol buffer text format.
public void
writeAsMessageSetTo(final CodedOutputStream output)

Serializes the set and writes it to output using MessageSet wire format.

public void
writeDelimitedTo(OutputStream output)

Implements com.google.protobuf.MessageLite.writeDelimitedTo.

Like writeTo(OutputStream), but writes the size of the message as a varint before writing the data.
public void
writeTo(final CodedOutputStream output)

Implements com.google.protobuf.MessageLite.writeTo.

Serializes the set and writes it to output.
public void
writeTo(final OutputStream output)

Implements com.google.protobuf.MessageLite.writeTo.

Serializes the message and writes it to output.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait