proto library Client - Class Cardinality (v5.36.2)

Reference documentation and code samples for the proto library Client class Cardinality.

Whether a field is optional, required, or repeated.

Protobuf type google.protobuf.Field.Cardinality

Namespace

Google \ Protobuf \ Field

Methods

static::name

Parameter
Name Description
value mixed

static::value

Parameter
Name Description
name mixed

Constants

CARDINALITY_UNKNOWN

Value: 0

For fields with unknown cardinality.

Generated from protobuf enum CARDINALITY_UNKNOWN = 0;

CARDINALITY_OPTIONAL

Value: 1

For optional fields.

Generated from protobuf enum CARDINALITY_OPTIONAL = 1;

CARDINALITY_REQUIRED

Value: 2

For required fields. Proto2 syntax only.

Generated from protobuf enum CARDINALITY_REQUIRED = 2;

CARDINALITY_REPEATED

Value: 3

For repeated fields.

Generated from protobuf enum CARDINALITY_REPEATED = 3;