|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.protobuf.UnknownFieldSet
public final class UnknownFieldSet
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 feilds 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 UnknownFieldSet.Builder
).
Most users will never need to use this class.
Nested Class Summary | |
---|---|
static class |
UnknownFieldSet.Builder
Builder for UnknownFieldSet s. |
static class |
UnknownFieldSet.Field
Represents a single field in an UnknownFieldSet . |
Method Summary | |
---|---|
java.util.Map<java.lang.Integer,UnknownFieldSet.Field> |
asMap()
Get a map of fields in the set by number. |
boolean |
equals(java.lang.Object other)
|
static UnknownFieldSet |
getDefaultInstance()
Get an empty UnknownFieldSet . |
UnknownFieldSet |
getDefaultInstanceForType()
Get an instance of the type with all fields set to their default values. |
UnknownFieldSet.Field |
getField(int number)
Get a field by number. |
int |
getSerializedSize()
Get the number of bytes required to encode this set. |
int |
getSerializedSizeAsMessageSet()
Get the number of bytes required to encode this set using MessageSet wire format. |
boolean |
hasField(int number)
Check if the given field number is present in the set. |
int |
hashCode()
|
boolean |
isInitialized()
Returns true if all required fields in the message and all embedded messages are set, false otherwise. |
static UnknownFieldSet.Builder |
newBuilder()
Create a new UnknownFieldSet.Builder . |
static UnknownFieldSet.Builder |
newBuilder(UnknownFieldSet copyFrom)
Create a new UnknownFieldSet.Builder and initialize it to be a copy
of copyFrom . |
UnknownFieldSet.Builder |
newBuilderForType()
Constructs a new builder for a message of the same type as this message. |
static UnknownFieldSet |
parseFrom(byte[] data)
Parse data as an UnknownFieldSet and return it. |
static UnknownFieldSet |
parseFrom(ByteString data)
Parse data as an UnknownFieldSet and return it. |
static UnknownFieldSet |
parseFrom(CodedInputStream input)
Parse an UnknownFieldSet from the given input stream. |
static UnknownFieldSet |
parseFrom(java.io.InputStream input)
Parse an UnknownFieldSet from input and return it. |
UnknownFieldSet.Builder |
toBuilder()
Constructs a builder initialized with the current message. |
byte[] |
toByteArray()
Serializes the message to a byte array and returns it. |
ByteString |
toByteString()
Serializes the message to a ByteString and returns it. |
java.lang.String |
toString()
Converts the set to a string in protocol buffer text format. |
void |
writeAsMessageSetTo(CodedOutputStream output)
Serializes the set and writes it to output using
MessageSet wire format. |
void |
writeDelimitedTo(java.io.OutputStream output)
Like MessageLite.writeTo(OutputStream) , but writes the size of the message
as a varint before writing the data. |
void |
writeTo(CodedOutputStream output)
Serializes the set and writes it to output . |
void |
writeTo(java.io.OutputStream output)
Serializes the message and writes it to output . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static UnknownFieldSet.Builder newBuilder()
UnknownFieldSet.Builder
.
public static UnknownFieldSet.Builder newBuilder(UnknownFieldSet copyFrom)
UnknownFieldSet.Builder
and initialize it to be a copy
of copyFrom
.
public static UnknownFieldSet getDefaultInstance()
UnknownFieldSet
.
public UnknownFieldSet getDefaultInstanceForType()
MessageLite
getDefaultInstance()
method of generated message classes in that
this method is an abstract method of the MessageLite
interface
whereas getDefaultInstance()
is a static method of a specific
class. They return the same thing.
getDefaultInstanceForType
in interface MessageLite
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.Map<java.lang.Integer,UnknownFieldSet.Field> asMap()
public boolean hasField(int number)
public UnknownFieldSet.Field getField(int number)
null
.
public void writeTo(CodedOutputStream output) throws java.io.IOException
output
.
writeTo
in interface MessageLite
java.io.IOException
public java.lang.String toString()
TextFormat.printToString(UnknownFieldSet)
.
toString
in class java.lang.Object
public ByteString toByteString()
ByteString
and returns it. This is
just a trivial wrapper around writeTo(CodedOutputStream)
.
toByteString
in interface MessageLite
public byte[] toByteArray()
byte
array and returns it. This is
just a trivial wrapper around writeTo(CodedOutputStream)
.
toByteArray
in interface MessageLite
public void writeTo(java.io.OutputStream output) throws java.io.IOException
output
. This is just a
trivial wrapper around writeTo(CodedOutputStream)
.
writeTo
in interface MessageLite
java.io.IOException
public void writeDelimitedTo(java.io.OutputStream output) throws java.io.IOException
MessageLite
MessageLite.writeTo(OutputStream)
, but writes the size of the message
as a varint before writing the data. This allows more data to be written
to the stream after the message without the need to delimit the message
data yourself. Use MessageLite.Builder.mergeDelimitedFrom(InputStream)
(or
the static method YourMessageType.parseDelimitedFrom(InputStream)
)
to parse messages written by this method.
writeDelimitedTo
in interface MessageLite
java.io.IOException
public int getSerializedSize()
getSerializedSize
in interface MessageLite
public void writeAsMessageSetTo(CodedOutputStream output) throws java.io.IOException
output
using
MessageSet
wire format.
java.io.IOException
public int getSerializedSizeAsMessageSet()
MessageSet
wire format.
public boolean isInitialized()
MessageLite
isInitialized
in interface MessageLite
public static UnknownFieldSet parseFrom(CodedInputStream input) throws java.io.IOException
UnknownFieldSet
from the given input stream.
java.io.IOException
public static UnknownFieldSet parseFrom(ByteString data) throws InvalidProtocolBufferException
data
as an UnknownFieldSet
and return it.
InvalidProtocolBufferException
public static UnknownFieldSet parseFrom(byte[] data) throws InvalidProtocolBufferException
data
as an UnknownFieldSet
and return it.
InvalidProtocolBufferException
public static UnknownFieldSet parseFrom(java.io.InputStream input) throws java.io.IOException
UnknownFieldSet
from input
and return it.
java.io.IOException
public UnknownFieldSet.Builder newBuilderForType()
MessageLite
newBuilderForType
in interface MessageLite
public UnknownFieldSet.Builder toBuilder()
MessageLite
toBuilder
in interface MessageLite
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |