public abstract class Message<M extends Message<M,B>,B extends Message.Builder<M,B>> extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
Message.Builder<M extends Message<M,B>,B extends Message.Builder<M,B>>
Superclass for protocol buffer message builders.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
hashCode
If non-zero, the hash code of this message.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Message(ProtoAdapter<M> adapter,
okio.ByteString unknownFields) |
| Modifier and Type | Method and Description |
|---|---|
ProtoAdapter<M> |
adapter()
The
ProtoAdapter for encoding and decoding messages of this type. |
byte[] |
encode()
Encode this message as a
byte[]. |
void |
encode(okio.BufferedSink sink)
Encode this message and write it to
stream. |
void |
encode(OutputStream stream)
Encode this message and write it to
stream. |
abstract Message.Builder<M,B> |
newBuilder()
Returns a new builder initialized with the data in this message.
|
String |
toString() |
okio.ByteString |
unknownFields()
Returns a byte string containing the proto encoding of this message's unknown fields.
|
M |
withoutUnknownFields()
Returns this message with any unknown fields removed.
|
protected Object |
writeReplace() |
protected transient int hashCode
protected Message(ProtoAdapter<M> adapter, okio.ByteString unknownFields)
public final okio.ByteString unknownFields()
public abstract Message.Builder<M,B> newBuilder()
public final M withoutUnknownFields()
protected final Object writeReplace() throws ObjectStreamException
ObjectStreamExceptionpublic final ProtoAdapter<M> adapter()
ProtoAdapter for encoding and decoding messages of this type.public final void encode(okio.BufferedSink sink)
throws IOException
stream.IOExceptionpublic final byte[] encode()
byte[].public final void encode(OutputStream stream) throws IOException
stream.IOExceptionCopyright © 2013–2017 Square, Inc.. All rights reserved.