EnumAdapter

expect abstract class EnumAdapter<E : WireEnum> : ProtoAdapter<E>

An abstract ProtoAdapter that converts values of an enum to and from integers.

actual abstract class EnumAdapter<E : WireEnum> : ProtoAdapter<E>

An abstract ProtoAdapter that converts values of an enum to and from integers.

actual abstract class EnumAdapter<E : WireEnum> : ProtoAdapter<E>

An abstract ProtoAdapter that converts values of an enum to and from integers.

Inheritors

actual abstract class EnumAdapter<E : WireEnum> : ProtoAdapter<E>

An abstract ProtoAdapter that converts values of an enum to and from integers.

Constructors

Link copied to clipboard
constructor(type: Class<E>, syntax: Syntax, identity: E?)
constructor(type: Class<E>)
constructor(type: Class<E>, syntax: Syntax)
constructor(type: KClass<E>)
constructor(type: KClass<E>, syntax: Syntax)

Properties

Link copied to clipboard
expect val identity: E?

A special value that is used when a field is absent from an encoded proto3 message. When encoding a proto3 message, fields that hold this value will be omitted.

actual val identity: E?
actual val identity: E?
actual val identity: E?
Link copied to clipboard
expect val sourceFile: String?

Path to the file containing the protobuf definition of this type.

actual val sourceFile: String?
actual val sourceFile: String?
actual val sourceFile: String?
Link copied to clipboard
expect val syntax: Syntax

Identifies the syntax in which type is defined in the proto schema. This string contains either "proto2" or "proto3".

actual val syntax: Syntax
actual val syntax: Syntax
actual val syntax: Syntax
Link copied to clipboard
expect val type: KClass<*>?
actual val type: KClass<*>?
actual val type: KClass<*>?
actual val type: KClass<*>?
Link copied to clipboard
expect val typeUrl: String?

Identifies this type for inclusion in a google.protobuf.Any. This is a string like "type.googleapis.com/packagename.messagename" or null if this type is either not a message (such as scalars and enums), or was code-generated before Wire 3.2 which introduced support for type URLS.

actual val typeUrl: String?
actual val typeUrl: String?
actual val typeUrl: String?

Functions

Link copied to clipboard
expect fun asPacked(): ProtoAdapter<List<E>>

Returns an adapter for E but as a packed, repeated value.

actual fun asPacked(): ProtoAdapter<List<E>>

Returns an adapter for E but as a packed, repeated value.

actual fun asPacked(): ProtoAdapter<List<E>>
actual fun asPacked(): ProtoAdapter<List<E>>

Returns an adapter for E but as a packed, repeated value.

Link copied to clipboard
expect fun asRepeated(): ProtoAdapter<List<E>>

Returns an adapter for E but as a repeated value.

actual fun asRepeated(): ProtoAdapter<List<E>>

Returns an adapter for E but as a repeated value.

actual fun asRepeated(): ProtoAdapter<List<E>>
actual fun asRepeated(): ProtoAdapter<List<E>>

Returns an adapter for E but as a repeated value.

Link copied to clipboard
expect open override fun decode(reader: ProtoReader): E

Read a non-null value from reader.

expect fun decode(bytes: ByteArray): E
expect fun decode(bytes: ByteString): E

Read an encoded message from bytes.

expect fun decode(source: BufferedSource): E

Read an encoded message from source.

actual open override fun decode(reader: ProtoReader): E

Read a non-null value from reader.

actual fun decode(bytes: ByteArray): E
actual fun decode(bytes: ByteString): E

Read an encoded message from bytes.

actual fun decode(source: BufferedSource): E

Read an encoded message from source.

actual open override fun decode(reader: ProtoReader): E
fun decode(stream: InputStream): E
actual fun decode(bytes: ByteArray): E
actual fun decode(source: BufferedSource): E
actual fun decode(bytes: ByteString): E
actual open override fun decode(reader: ProtoReader): E

Read a non-null value from reader.

actual fun decode(bytes: ByteArray): E
actual fun decode(bytes: ByteString): E

Read an encoded message from bytes.

actual fun decode(source: BufferedSource): E

Read an encoded message from source.

Link copied to clipboard
fun <E> ProtoAdapter<E>.decode(data: <Error class: unknown class>): E

Read an encoded message from data.

Link copied to clipboard
expect open override fun encode(writer: ProtoWriter, value: E)
expect open override fun encode(writer: ReverseProtoWriter, value: E)

Write non-null value to writer.

expect fun encode(value: E): ByteArray

Encode value as a byte[].

expect fun encode(sink: BufferedSink, value: E)

Encode value and write it to stream.

actual open override fun encode(writer: ProtoWriter, value: E)
actual open override fun encode(writer: ReverseProtoWriter, value: E)

Write non-null value to writer.

actual fun encode(value: E): ByteArray

Encode value as a byte[].

actual fun encode(sink: BufferedSink, value: E)

Encode value and write it to stream.

actual open override fun encode(writer: ProtoWriter, value: E)
actual open override fun encode(writer: ReverseProtoWriter, value: E)
actual fun encode(value: E): ByteArray
fun encode(stream: OutputStream, value: E)
actual fun encode(sink: BufferedSink, value: E)
actual open override fun encode(writer: ProtoWriter, value: E)
actual open override fun encode(writer: ReverseProtoWriter, value: E)

Write non-null value to writer.

actual fun encode(value: E): ByteArray

Encode value as a byte[].

actual fun encode(sink: BufferedSink, value: E)

Encode value and write it to stream.

encodeByteString
Link copied to clipboard
expect fun encodeByteString(value: E): ByteString

Encode value as a ByteString.

actual fun encodeByteString(value: E): ByteString

Encode value as a ByteString.

actual fun encodeByteString(value: E): ByteString
actual fun encodeByteString(value: E): ByteString

Encode value as a ByteString.

Link copied to clipboard
expect open override fun encodedSize(value: E): Int

The size of the non-null data value. This does not include the size required for a length-delimited prefix (should the type require one).

actual open override fun encodedSize(value: E): Int

The size of the non-null data value. This does not include the size required for a length-delimited prefix (should the type require one).

actual open override fun encodedSize(value: E): Int
actual open override fun encodedSize(value: E): Int

The size of the non-null data value. This does not include the size required for a length-delimited prefix (should the type require one).

encodedSizeWithTag
Link copied to clipboard
expect open fun encodedSizeWithTag(tag: Int, value: E?): Int

The size of tag and value in the wire format. This size includes the tag, type, length-delimited prefix (should the type require one), and value. Returns 0 if value is null.

actual open fun encodedSizeWithTag(tag: Int, value: E?): Int

The size of tag and value in the wire format. This size includes the tag, type, length-delimited prefix (should the type require one), and value. Returns 0 if value is null.

actual open fun encodedSizeWithTag(tag: Int, value: E?): Int
actual open fun encodedSizeWithTag(tag: Int, value: E?): Int

The size of tag and value in the wire format. This size includes the tag, type, length-delimited prefix (should the type require one), and value. Returns 0 if value is null.

encodeWithTag
Link copied to clipboard
expect open fun encodeWithTag(writer: ProtoWriter, tag: Int, value: E?)
expect open fun encodeWithTag(writer: ReverseProtoWriter, tag: Int, value: E?)

Write tag and value to writer. If value is null this does nothing.

actual open fun encodeWithTag(writer: ProtoWriter, tag: Int, value: E?)
actual open fun encodeWithTag(writer: ReverseProtoWriter, tag: Int, value: E?)

Write tag and value to writer. If value is null this does nothing.

actual open fun encodeWithTag(writer: ProtoWriter, tag: Int, value: E?)
actual open fun encodeWithTag(writer: ReverseProtoWriter, tag: Int, value: E?)
actual open fun encodeWithTag(writer: ProtoWriter, tag: Int, value: E?)
actual open fun encodeWithTag(writer: ReverseProtoWriter, tag: Int, value: E?)

Write tag and value to writer. If value is null this does nothing.

Link copied to clipboard
expect open override fun redact(value: E): E

Returns the redacted form of value.

actual open override fun redact(value: E): E

Returns the redacted form of value.

actual open override fun redact(value: E): E
actual open override fun redact(value: E): E

Returns the redacted form of value.

toString
Link copied to clipboard
expect open fun toString(value: E): String

Returns a human-readable version of the given value.

actual open fun toString(value: E): String

Returns a human-readable version of the given value.

actual open fun toString(value: E): String
actual open fun toString(value: E): String

Returns a human-readable version of the given value.

tryDecode
Link copied to clipboard
expect fun tryDecode(reader: ProtoReader, destination: MutableList<E>)

Reads a value and appends it to destination if this has data available. Otherwise, it will only clear the reader state.

actual fun tryDecode(reader: ProtoReader, destination: MutableList<E>)
actual fun tryDecode(reader: ProtoReader, destination: MutableList<E>)
actual fun tryDecode(reader: ProtoReader, destination: MutableList<E>)