|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.protobuf.UnknownFieldSet.Builder
public static final class UnknownFieldSet.Builder
Builder for UnknownFieldSet
s.
Note that this class maintains UnknownFieldSet.Field.Builder
s for all fields
in the set. Thus, adding one element to an existing UnknownFieldSet.Field
does not
require making a copy. This is important for efficient parsing of
unknown repeated fields. However, it implies that UnknownFieldSet.Field
s cannot
be constructed independently, nor can two UnknownFieldSet
s share
the same Field
object.
Use UnknownFieldSet.newBuilder()
to construct a Builder
.
Method Summary | |
---|---|
UnknownFieldSet.Builder |
addField(int number,
UnknownFieldSet.Field field)
Add a field to the UnknownFieldSet . |
java.util.Map<java.lang.Integer,UnknownFieldSet.Field> |
asMap()
Get all present Field s as an immutable Map . |
UnknownFieldSet |
build()
Build the UnknownFieldSet and return it. |
UnknownFieldSet.Builder |
clear()
Reset the builder to an empty set. |
boolean |
hasField(int number)
Check if the given field number is present in the set. |
UnknownFieldSet.Builder |
mergeField(int number,
UnknownFieldSet.Field field)
Add a field to the UnknownFieldSet . |
boolean |
mergeFieldFrom(int tag,
CodedInputStream input)
Parse a single field from input and merge it into this set. |
UnknownFieldSet.Builder |
mergeFrom(byte[] data)
Parse data as an UnknownFieldSet and merge it with the
set being built. |
UnknownFieldSet.Builder |
mergeFrom(ByteString data)
Parse data as an UnknownFieldSet and merge it with the
set being built. |
UnknownFieldSet.Builder |
mergeFrom(CodedInputStream input)
Parse an entire message from input and merge its fields into
this set. |
UnknownFieldSet.Builder |
mergeFrom(java.io.InputStream input)
Parse an UnknownFieldSet from input and merge it with the
set being built. |
UnknownFieldSet.Builder |
mergeFrom(UnknownFieldSet other)
Merge the fields from other into this set. |
UnknownFieldSet.Builder |
mergeVarintField(int number,
int value)
Convenience method for merging a new field containing a single varint value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public UnknownFieldSet build()
UnknownFieldSet
and return it.
Once build()
has been called, the Builder
will no
longer be usable. Calling any method after build()
will throw
NullPointerException
.
public UnknownFieldSet.Builder clear()
public UnknownFieldSet.Builder mergeFrom(UnknownFieldSet other)
other
into this set. If a field number
exists in both sets, other
's values for that field will be
appended to the values in this set.
public UnknownFieldSet.Builder mergeField(int number, UnknownFieldSet.Field field)
UnknownFieldSet
. If a field with the same
number already exists, the two are merged.
public UnknownFieldSet.Builder mergeVarintField(int number, int value)
public boolean hasField(int number)
public UnknownFieldSet.Builder addField(int number, UnknownFieldSet.Field field)
UnknownFieldSet
. If a field with the same
number already exists, it is removed.
public java.util.Map<java.lang.Integer,UnknownFieldSet.Field> asMap()
Field
s as an immutable Map
. If more
fields are added, the changes may or may not be reflected in this map.
public UnknownFieldSet.Builder mergeFrom(CodedInputStream input) throws java.io.IOException
input
and merge its fields into
this set.
java.io.IOException
public boolean mergeFieldFrom(int tag, CodedInputStream input) throws java.io.IOException
input
and merge it into this set.
tag
- The field's tag number, which was already parsed.
false
if the tag is an engroup tag.
java.io.IOException
public UnknownFieldSet.Builder mergeFrom(ByteString data) throws InvalidProtocolBufferException
data
as an UnknownFieldSet
and merge it with the
set being built. This is just a small wrapper around
mergeFrom(CodedInputStream)
.
InvalidProtocolBufferException
public UnknownFieldSet.Builder mergeFrom(byte[] data) throws InvalidProtocolBufferException
data
as an UnknownFieldSet
and merge it with the
set being built. This is just a small wrapper around
mergeFrom(CodedInputStream)
.
InvalidProtocolBufferException
public UnknownFieldSet.Builder mergeFrom(java.io.InputStream input) throws java.io.IOException
UnknownFieldSet
from input
and merge it with the
set being built. This is just a small wrapper around
mergeFrom(CodedInputStream)
.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |