Any Message
class AnyMessage(val typeUrl: String, val value: ByteString = ByteString.EMPTY) : Message<AnyMessage, Nothing>
Wire implementation of the google.protobuf.Any
type. The Any
type wraps an arbitrary protobuf message. Field of Any
generated by Wire will be typed AnyMessage. typeUrl is used to identify the type of the message, defined as 'type.googleapis.com/full.type.name'. value is the serialized representation of the wrapped message. The pack and unpack methods are available to wrap and unwrap an Any
message.
Example
val person: Person = anyMessage.unpack(Person.ADAPTER)
val anyMessage: AnyMessage = AnyMessage.ADAPTER.pack(person)
Content copied to clipboard
Properties
Link copied to clipboard
The ProtoAdapter for encoding and decoding messages of this type.
Link copied to clipboard
Returns a byte string containing the proto encoding of this message's unknown fields. Returns an empty byte string if this message has no unknown fields.