Skip to content


wire-runtime / com.squareup.wire

Package com.squareup.wire


Name Summary
abstract class AndroidMessage<M :Message<M,B>, B :Builder<M,B>> :Message<M,B>
An Android-specific Message which adds support for Parcelable.
AnyMessage class AnyMessage :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 ‘’. value is the serialized representation of the wrapped message. The pack and unpack methods are available to wrap and unwrap an Any message.
Duration expect class Duration
A measurement of time. Durations may be positive, zero, or negative.
(JVM, js, native)
abstract expect class EnumAdapter<E :WireEnum> :ProtoAdapter<E>
An abstract ProtoAdapter that converts values of an enum to and from integers.
FieldEncoding enum class FieldEncoding
Instant expect class Instant
This represents a timestamp, though we use the name ‘instant’ in the runtime because that’s what the JVM libraries use, and ‘Timestamp’ means something else on that platform.
(JVM, js, native)
abstract expect class Message<M :Message<M,B>, B :Builder<M,B>>
A protocol buffer message.
(JVM, js, native)
expect interface MessageSink<in T :Any>
A writable stream of messages.
(JVM, js, native)
expect interface MessageSource<out T :Any>
A readable stream of messages.
(JVM, js, native)
abstract expect class ProtoAdapter<E>
ProtoReader class ProtoReader
Reads and decodes protocol message fields.
ProtoWriter class ProtoWriter
Utilities for encoding and writing protocol message fields.
Service interface Service
Syntax enum class Syntax
Syntax version.
WireEnum interface WireEnum
Interface for generated Enum values to help serialization and deserialization.


Name Summary
WireField annotation class WireField
Annotates generated Message fields with metadata for serialization and deserialization.
WireRpc annotation class WireRpc
For gRPC actions the path is formatted as /<service name>/<method name>. The path of the proto service below is /squareup.helloworld.Greeter/SayHello.

Type Aliases

Name Summary
actual typealias Duration =Duration
actual typealias Instant =Instant


Name Summary
(JVM, js, native)
expect fun durationOfSeconds(seconds:Long, nano:Long):Duration
fun <T> get(value:T?, defaultValue:T):T
Returns value if it is not null; defaultValue otherwise. This is used to conveniently return a default value when a value is null. For example,
(JVM, js, native)
expect fun ofEpochSecond(epochSecond:Long, nano:Long):Instant