public abstract class ExtendableMessageNano<M extends ExtendableMessageNano<M>> extends MessageNano
Modifier and Type | Field and Description |
---|---|
protected FieldArray |
unknownFieldData
A container for fields unknown to the message, including extensions.
|
cachedSize
Constructor and Description |
---|
ExtendableMessageNano() |
Modifier and Type | Method and Description |
---|---|
M |
clone()
Provides support for cloning.
|
protected int |
computeSerializedSize()
Computes the number of bytes required to encode this message.
|
<T> T |
getExtension(Extension<M,T> extension)
Gets the value stored in the specified extension of this message.
|
boolean |
hasExtension(Extension<M,?> extension)
Checks if there is a value stored for the specified extension in this
message.
|
<T> M |
setExtension(Extension<M,T> extension,
T value)
Sets the value of the specified extension of this message.
|
protected boolean |
storeUnknownField(CodedInputByteBufferNano input,
int tag)
Stores the binary data of an unknown field.
|
void |
writeTo(CodedOutputByteBufferNano output)
Serializes the message and writes it to
output . |
getCachedSize, getSerializedSize, mergeFrom, mergeFrom, mergeFrom, messageNanoEquals, toByteArray, toByteArray, toString
protected FieldArray unknownFieldData
getExtension(com.google.protobuf.nano.Extension<M, T>)
and setExtension(com.google.protobuf.nano.Extension<M, T>, T)
methods.protected int computeSerializedSize()
MessageNano
computeSerializedSize
in class MessageNano
public void writeTo(CodedOutputByteBufferNano output) throws IOException
MessageNano
output
.writeTo
in class MessageNano
output
- the output to receive the serialized form.IOException
- if an error occurred writing to output
.public final boolean hasExtension(Extension<M,?> extension)
public final <T> T getExtension(Extension<M,T> extension)
public final <T> M setExtension(Extension<M,T> extension, T value)
protected final boolean storeUnknownField(CodedInputByteBufferNano input, int tag) throws IOException
Generated messages will call this for unknown fields if the store_unknown_fields option is on.
Note that the tag might be a end-group tag (rather than the start of an unknown field) in which case we do not want to add an unknown field entry.
input
- the input buffer.tag
- the tag of the field.IOException
public M clone() throws CloneNotSupportedException
MessageNano
clone
in class MessageNano
CloneNotSupportedException
Copyright © 2008–2017. All rights reserved.