WireField

@Target(allowedTargets = [AnnotationTarget.FIELD])
annotation class WireField(val tag: Int, val keyAdapter: String = "", val adapter: String, val label: WireField.Label = Label.OPTIONAL, val redacted: Boolean = false, val declaredName: String = "", val jsonName: String = "", val oneofName: String = "", val schemaIndex: Int = -1)

Annotates generated Message fields with metadata for serialization and deserialization.

Types

Link copied to clipboard

A protocol buffer label.

Properties

Link copied to clipboard

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.

Link copied to clipboard

Name of this field as declared in the proto schema. This value is set to a non-empty string only when the declared name differs from the generated one; for instance, a proto field named final generated in Java will be renamed to final_.

Link copied to clipboard

Name representing this field as it should be used in JSON. This value is set to a non-empty string only when the json name differs from the name as declared in the proto schema.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

Name of the oneof this field belongs to. This value is set to a non-empty string only if the field is part of a oneof.

Link copied to clipboard
val redacted: Boolean = false

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

Link copied to clipboard

This is the order that this field was declared in the .proto schema.

Link copied to clipboard
val tag: Int

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