Field

interface Field(source)

A single field of a message type.

Types

Link copied to clipboard
sealed class Cardinality(val number: Int)

Whether a field is optional, required, or repeated.

Link copied to clipboard
sealed class Kind(val number: Int)

Basic field types.

Properties

Link copied to clipboard

The field cardinality.

Link copied to clipboard
abstract val defaultValue: String

The string value of the default value of this field. Proto2 syntax only.

Link copied to clipboard
abstract val jsonName: String

The field JSON name.

Link copied to clipboard
abstract val kind: Field.Kind

The field type.

Link copied to clipboard
abstract val name: String

The field name.

Link copied to clipboard
abstract val number: Int

The field number.

Link copied to clipboard
abstract val oneofIndex: Int

The index of the field type in Type.oneofs, for message or enumeration types. The first type has index 1; zero means the type is not in the list.

Link copied to clipboard
abstract val options: List<Option>

The protocol buffer options.

Link copied to clipboard
abstract val packed: Boolean

Whether to use alternative packed wire representation.

Link copied to clipboard
abstract val typeUrl: String

The field type URL, without the scheme, for message or enumeration types. Example: "type.googleapis.com/google.protobuf.Timestamp".

Functions

Link copied to clipboard
fun Field.copy(body: ERROR CLASS: Symbol not found for Field.Builder.() -> Unit = {}): Field

Copies the original message, including unknown fields.