Top Description Fields Constructors Methods
com.google.protobuf.nano

public abstract Class ExtendableMessageNano<M extends com.google.protobuf.nano.ExtendableMessageNano<M>>

extends MessageNano
Class Inheritance
Imports
java.io.IOException

Base class of those Protocol Buffer messages that need to store unknown fields, such as extensions.

Field Summary

Modifier and TypeField and Description
protected FieldArray
unknownFieldData

A container for fields unknown to the message, including extensions.

Inherited from com.google.protobuf.nano.MessageNano:
cachedSize

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public M
clone()

Overrides com.google.protobuf.nano.MessageNano.clone.

Provides support for cloning.
protected int
computeSerializedSize()

Overrides com.google.protobuf.nano.MessageNano.computeSerializedSize.

Computes the number of bytes required to encode this message.
public final <T> T
getExtension(Extension<M, T> extension)

Gets the value stored in the specified extension of this message.

public final boolean
hasExtension(Extension<M, ?> extension)

Checks if there is a value stored for the specified extension in this message.

public final <T> M
setExtension(Extension<M, T> extension, T value)

Sets the value of the specified extension of this message.

protected final boolean

Returns:

true unless the tag is an end-group tag.
storeUnknownField
(CodedInputByteBufferNano
the input buffer.
input
,
int
the tag of the field.
tag
)

Stores the binary data of an unknown field.

public void
writeTo(CodedOutputByteBufferNano
the output to receive the serialized form.
output
)

Overrides com.google.protobuf.nano.MessageNano.writeTo.

Serializes the message and writes it to output.
Inherited from com.google.protobuf.nano.MessageNano:
getCachedSizegetSerializedSizemergeFrommergeFrommergeFrommessageNanoEqualstoByteArraytoByteArraytoString

Field Detail

unknownFieldDataback to summary
protected FieldArray unknownFieldData

A container for fields unknown to the message, including extensions. Extension fields can can be accessed through the getExtension and setExtension methods.

Constructor Detail

ExtendableMessageNanoback to summary
public ExtendableMessageNano()

Method Detail

cloneback to summary
public M clone() throws CloneNotSupportedException

Overrides com.google.protobuf.nano.MessageNano.clone.

Doc from com.google.protobuf.nano.MessageNano.clone.

Provides support for cloning. This only works if you specify the generate_clone method.

Returns:M

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
Exceptions
CloneNotSupportedException:

Doc from java.lang.Object.clone.

if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

computeSerializedSizeback to summary
protected int computeSerializedSize()

Overrides com.google.protobuf.nano.MessageNano.computeSerializedSize.

Doc from com.google.protobuf.nano.MessageNano.computeSerializedSize.

Computes the number of bytes required to encode this message. This does not update the cached size.

Annotations
@Override
getExtensionback to summary
public final <T> T getExtension(Extension<M, T> extension)

Gets the value stored in the specified extension of this message.

hasExtensionback to summary
public final boolean hasExtension(Extension<M, ?> extension)

Checks if there is a value stored for the specified extension in this message.

setExtensionback to summary
public final <T> M setExtension(Extension<M, T> extension, T value)

Sets the value of the specified extension of this message.

storeUnknownFieldback to summary
protected final boolean storeUnknownField(CodedInputByteBufferNano input, int tag) throws IOException

Stores the binary data of an unknown field.

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.

Parameters
input:CodedInputByteBufferNano

the input buffer.

tag:int

the tag of the field.

Returns:boolean

true unless the tag is an end-group tag.

writeToback to summary
public void writeTo(CodedOutputByteBufferNano output) throws IOException

Overrides com.google.protobuf.nano.MessageNano.writeTo.

Doc from com.google.protobuf.nano.MessageNano.writeTo.

Serializes the message and writes it to output.

Parameters
output:CodedOutputByteBufferNano

the output to receive the serialized form.

Annotations
@Override
Exceptions
IOException:
if an error occurred writing to output.