Class: Field

Field(opt_dataopt)

new Field(opt_dataopt)

Generated by JsPbCodeGenerator.
Parameters:
Name Type Attributes Description
opt_data Array <optional>
Optional initial data array, typically from a server response, or constructed directly in Javascript. The array is used in place and becomes part of the constructed object. It is not cloned. If no data is provided, the constructed object will be empty, but still valid.
Source:

Extends

  • jspb.Message

Members

(static) Cardinality :number

Type:
  • number
Properties:
Name Type Description
CARDINALITY_UNKNOWN number
CARDINALITY_OPTIONAL number
CARDINALITY_REQUIRED number
CARDINALITY_REPEATED number
Source:

(static) Kind :number

Type:
  • number
Properties:
Name Type Description
TYPE_UNKNOWN number
TYPE_DOUBLE number
TYPE_FLOAT number
TYPE_INT64 number
TYPE_UINT64 number
TYPE_INT32 number
TYPE_FIXED64 number
TYPE_FIXED32 number
TYPE_BOOL number
TYPE_STRING number
TYPE_GROUP number
TYPE_MESSAGE number
TYPE_BYTES number
TYPE_UINT32 number
TYPE_ENUM number
TYPE_SFIXED32 number
TYPE_SFIXED64 number
TYPE_SINT32 number
TYPE_SINT64 number
Source:

(static) displayName

Source:

Methods

addOptions(opt_valueopt, non-null, opt_indexopt) → (non-null) {proto.google.protobuf.Option}

Parameters:
Name Type Attributes Description
opt_value proto.google.protobuf.Option <optional>
opt_index number <optional>
Source:
Returns:
Type
proto.google.protobuf.Option

clearOptionsList() → (non-null) {proto.google.protobuf.Field}

Clears the list making it empty but non-null.
Source:
Returns:
returns this
Type
proto.google.protobuf.Field

getCardinality() → (non-null) {proto.google.protobuf.Field.Cardinality}

optional Cardinality cardinality = 2;
Source:
Returns:
Type
proto.google.protobuf.Field.Cardinality

getDefaultValue() → {string}

optional string default_value = 11;
Source:
Returns:
Type
string

getJsonName() → {string}

optional string json_name = 10;
Source:
Returns:
Type
string

getKind() → (non-null) {proto.google.protobuf.Field.Kind}

optional Kind kind = 1;
Source:
Returns:
Type
proto.google.protobuf.Field.Kind

getName() → {string}

optional string name = 4;
Source:
Returns:
Type
string

getNumber() → {number}

optional int32 number = 3;
Source:
Returns:
Type
number

getOneofIndex() → {number}

optional int32 oneof_index = 7;
Source:
Returns:
Type
number

getOptionsList() → (non-null) {Array.<!proto.google.protobuf.Option>}

repeated Option options = 9;
Source:
Returns:
Type
Array.<!proto.google.protobuf.Option>

getPacked() → {boolean}

optional bool packed = 8;
Source:
Returns:
Type
boolean

getTypeUrl() → {string}

optional string type_url = 6;
Source:
Returns:
Type
string

serializeBinary() → (non-null) {Uint8Array}

Serializes the message to binary data (in protobuf wire format).
Source:
Returns:
Type
Uint8Array

setCardinality(valuenon-null) → (non-null) {proto.google.protobuf.Field}

Parameters:
Name Type Description
value proto.google.protobuf.Field.Cardinality
Source:
Returns:
returns this
Type
proto.google.protobuf.Field

setDefaultValue(value) → (non-null) {proto.google.protobuf.Field}

Parameters:
Name Type Description
value string
Source:
Returns:
returns this
Type
proto.google.protobuf.Field

setJsonName(value) → (non-null) {proto.google.protobuf.Field}

Parameters:
Name Type Description
value string
Source:
Returns:
returns this
Type
proto.google.protobuf.Field

setKind(valuenon-null) → (non-null) {proto.google.protobuf.Field}

Parameters:
Name Type Description
value proto.google.protobuf.Field.Kind
Source:
Returns:
returns this
Type
proto.google.protobuf.Field

setName(value) → (non-null) {proto.google.protobuf.Field}

Parameters:
Name Type Description
value string
Source:
Returns:
returns this
Type
proto.google.protobuf.Field

setNumber(value) → (non-null) {proto.google.protobuf.Field}

Parameters:
Name Type Description
value number
Source:
Returns:
returns this
Type
proto.google.protobuf.Field

setOneofIndex(value) → (non-null) {proto.google.protobuf.Field}

Parameters:
Name Type Description
value number
Source:
Returns:
returns this
Type
proto.google.protobuf.Field

setOptionsList(valuenon-null) → (non-null) {proto.google.protobuf.Field}

Parameters:
Name Type Description
value Array.<!proto.google.protobuf.Option>
Source:
Returns:
returns this
Type
proto.google.protobuf.Field

setPacked(value) → (non-null) {proto.google.protobuf.Field}

Parameters:
Name Type Description
value boolean
Source:
Returns:
returns this
Type
proto.google.protobuf.Field

setTypeUrl(value) → (non-null) {proto.google.protobuf.Field}

Parameters:
Name Type Description
value string
Source:
Returns:
returns this
Type
proto.google.protobuf.Field

toObject(opt_includeInstanceopt) → (non-null) {Object}

Creates an object representation of this proto. Field names that are reserved in JavaScript and will be renamed to pb_name. Optional fields that are not set will be set to undefined. To access a reserved field use, foo.pb_, eg, foo.pb_default. For the list of reserved names please see: net/proto2/compiler/js/internal/generator.cc#kKeyword.
Parameters:
Name Type Attributes Description
opt_includeInstance boolean <optional>
Deprecated. whether to include the JSPB instance for transitional soy proto support: http://goto/soy-param-migration
Source:
Returns:
Type
Object

(static) deserializeBinary(bytes) → (non-null) {proto.google.protobuf.Field}

Deserializes binary data (in protobuf wire format).
Parameters:
Name Type Description
bytes jspb.ByteSource The bytes to deserialize.
Source:
Returns:
Type
proto.google.protobuf.Field

(static) deserializeBinaryFromReader(msgnon-null, readernon-null) → (non-null) {proto.google.protobuf.Field}

Deserializes binary data (in protobuf wire format) from the given reader into the given message object.
Parameters:
Name Type Description
msg proto.google.protobuf.Field The message object to deserialize into.
reader jspb.BinaryReader The BinaryReader to use.
Source:
Returns:
Type
proto.google.protobuf.Field

(static) serializeBinaryToWriter(messagenon-null, writernon-null)

Serializes the given message to binary data (in protobuf wire format), writing to the given BinaryWriter.
Parameters:
Name Type Description
message proto.google.protobuf.Field
writer jspb.BinaryWriter
Source:

(static) toObject(includeInstance, msgnon-null) → (non-null) {Object}

Static version of the {@see toObject} method.
Parameters:
Name Type Description
includeInstance boolean | undefined Deprecated. Whether to include the JSPB instance for transitional soy proto support: http://goto/soy-param-migration
msg proto.google.protobuf.Field The msg instance to transform.
Source:
Returns:
Type
Object