wire-runtime / com.squareup.wire / WireField

WireField

@Target([AnnotationTarget.FIELD]) class WireField

Annotates generated Message fields with metadata for serialization and deserialization.

Types

Label

class Label

A protocol buffer label.

Constructors

<init>

WireField(tag: Int, keyAdapter: String, adapter: String, label: Label, redacted: Boolean)

Annotates generated Message fields with metadata for serialization and deserialization.

Properties

adapter

val adapter: String

Reference to the static field that holds a ProtoAdapter that can encode and decode this field's values. The reference is a string like com.squareup.wire.protos.person.Person#ADAPTER and contains a fully-qualified class name followed by a hash symbol and a field name.

keyAdapter

val keyAdapter: String

Reference to the static field that holds a ProtoAdapter that can encode and decode this field's keys. This only applies to maps. See #adapter() for a description of the value format.

label

val label: Label

The field's protocol buffer label, one of Label#OPTIONAL, Label#REQUIRED, Label#REPEATED, or Label#PACKED. Defaults to Label#OPTIONAL.

redacted

val redacted: Boolean

Redacted fields are omitted from toString() to protect sensitive data. Defaults to false.

tag

val tag: Int

The tag number used to store the field's value.