Skip to content

wire-runtime

wire-runtime / com.squareup.wire

Package com.squareup.wire

Types

Name Summary
AndroidMessage
(JVM)
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 ‘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.
Duration expect class Duration
A measurement of time. Durations may be positive, zero, or negative.
EnumAdapter
(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.
Message
(JVM, js, native)
abstract expect class Message<M :Message<M,B>, B :Builder<M,B>>
A protocol buffer message.
MessageSink
(JVM, js, native)
expect interface MessageSink<in T :Any>
A writable stream of messages.
MessageSource
(JVM, js, native)
expect interface MessageSource<out T :Any>
A readable stream of messages.
ProtoAdapter
(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.

Annotations

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
Duration
(JVM)
actual typealias Duration =Duration
Instant
(JVM)
actual typealias Instant =Instant

Functions

Name Summary
durationOfSeconds
(JVM, js, native)
expect fun durationOfSeconds(seconds:Long, nano:Long):Duration
get
(JVM)
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,
ofEpochSecond
(JVM, js, native)
expect fun ofEpochSecond(epochSecond:Long, nano:Long):Instant