FieldDescriptorProto

google.protobuf. FieldDescriptorProto

Represents a FieldDescriptorProto.

Constructor

new FieldDescriptorProto(propertiesopt)

Constructs a new FieldDescriptorProto.

Parameters:
Name Type Attributes Description
properties google.protobuf.IFieldDescriptorProto <optional>

Properties to set

Implements:
  • IFieldDescriptorProto

Members

defaultValue

FieldDescriptorProto defaultValue.

extendee

FieldDescriptorProto extendee.

jsonName

FieldDescriptorProto jsonName.

label

FieldDescriptorProto label.

name

FieldDescriptorProto name.

number

FieldDescriptorProto number.

oneofIndex

FieldDescriptorProto oneofIndex.

options

FieldDescriptorProto options.

proto3Optional

FieldDescriptorProto proto3Optional.

type

FieldDescriptorProto type.

typeName

FieldDescriptorProto typeName.

Label

Label enum.

Properties:
Name Type Description
LABEL_OPTIONAL number

LABEL_OPTIONAL value

LABEL_REQUIRED number

LABEL_REQUIRED value

LABEL_REPEATED number

LABEL_REPEATED value

Type

Type enum.

Properties:
Name Type Description
TYPE_DOUBLE number

TYPE_DOUBLE value

TYPE_FLOAT number

TYPE_FLOAT value

TYPE_INT64 number

TYPE_INT64 value

TYPE_UINT64 number

TYPE_UINT64 value

TYPE_INT32 number

TYPE_INT32 value

TYPE_FIXED64 number

TYPE_FIXED64 value

TYPE_FIXED32 number

TYPE_FIXED32 value

TYPE_BOOL number

TYPE_BOOL value

TYPE_STRING number

TYPE_STRING value

TYPE_GROUP number

TYPE_GROUP value

TYPE_MESSAGE number

TYPE_MESSAGE value

TYPE_BYTES number

TYPE_BYTES value

TYPE_UINT32 number

TYPE_UINT32 value

TYPE_ENUM number

TYPE_ENUM value

TYPE_SFIXED32 number

TYPE_SFIXED32 value

TYPE_SFIXED64 number

TYPE_SFIXED64 value

TYPE_SINT32 number

TYPE_SINT32 value

TYPE_SINT64 number

TYPE_SINT64 value

Methods

toJSON() → {Object.<string, *>}

Converts this FieldDescriptorProto to JSON.

Returns:
Type Description
Object.<string, *>

JSON object

(static) create(propertiesopt) → {google.protobuf.FieldDescriptorProto}

Creates a new FieldDescriptorProto instance using the specified properties.

Parameters:
Name Type Attributes Description
properties google.protobuf.IFieldDescriptorProto <optional>

Properties to set

Returns:
Type Description
google.protobuf.FieldDescriptorProto

FieldDescriptorProto instance

(static) decode(reader, lengthopt) → {google.protobuf.FieldDescriptorProto}

Decodes a FieldDescriptorProto message from the specified reader or buffer.

Parameters:
Name Type Attributes Description
reader $protobuf.Reader | Uint8Array

Reader or buffer to decode from

length number <optional>

Message length if known beforehand

Returns:
Type Description
google.protobuf.FieldDescriptorProto

FieldDescriptorProto

Throws:
  • If the payload is not a reader or valid buffer

    Type
    Error
  • If required fields are missing

    Type
    $protobuf.util.ProtocolError

(static) decodeDelimited(reader) → {google.protobuf.FieldDescriptorProto}

Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.

Parameters:
Name Type Description
reader $protobuf.Reader | Uint8Array

Reader or buffer to decode from

Returns:
Type Description
google.protobuf.FieldDescriptorProto

FieldDescriptorProto

Throws:
  • If the payload is not a reader or valid buffer

    Type
    Error
  • If required fields are missing

    Type
    $protobuf.util.ProtocolError

(static) encode(message, writeropt) → {$protobuf.Writer}

Encodes the specified FieldDescriptorProto message. Does not implicitly verify messages.

Parameters:
Name Type Attributes Description
message google.protobuf.IFieldDescriptorProto

FieldDescriptorProto message or plain object to encode

writer $protobuf.Writer <optional>

Writer to encode to

Returns:
Type Description
$protobuf.Writer

Writer

(static) encodeDelimited(message, writeropt) → {$protobuf.Writer}

Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly verify messages.

Parameters:
Name Type Attributes Description
message google.protobuf.IFieldDescriptorProto

FieldDescriptorProto message or plain object to encode

writer $protobuf.Writer <optional>

Writer to encode to

Returns:
Type Description
$protobuf.Writer

Writer

(static) fromObject(object) → {google.protobuf.FieldDescriptorProto}

Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.

Parameters:
Name Type Description
object Object.<string, *>

Plain object

Returns:
Type Description
google.protobuf.FieldDescriptorProto

FieldDescriptorProto

(static) getTypeUrl(typeUrlPrefixopt) → {string}

Gets the default type url for FieldDescriptorProto

Parameters:
Name Type Attributes Description
typeUrlPrefix string <optional>

your custom typeUrlPrefix(default "type.googleapis.com")

Returns:
Type Description
string

The default type url

(static) toObject(message, optionsopt) → {Object.<string, *>}

Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.

Parameters:
Name Type Attributes Description
message google.protobuf.FieldDescriptorProto

FieldDescriptorProto

options $protobuf.IConversionOptions <optional>

Conversion options

Returns:
Type Description
Object.<string, *>

Plain object

(static) verify(message) → {string|null}

Verifies a FieldDescriptorProto message.

Parameters:
Name Type Description
message Object.<string, *>

Plain object to verify

Returns:
Type Description
string | null

null if valid, otherwise the reason why it is not