NOTE: This site is deprecated. The site will be turned down after January 31, 2023, and traffic will redirect to the new site at https://protobuf.dev. In the meantime, updates will be made only to protobuf.dev.
Stay organized with collections Save and categorize content based on your preferences.

Google.Protobuf.Collections.MapField< TKey, TValue >.Codec

A codec for a specific map field.

Summary

This contains all the information required to encode and decode the nested messages.

Constructors and Destructors

Codec(FieldCodec< TKey > keyCodec, FieldCodec< TValue > valueCodec, uint mapTag)
Creates a new entry codec based on a separate key codec and value codec, and the tag to use for each map entry.

Properties

MapTag
uint
The tag used in the enclosing message to indicate map entries.

Properties

MapTag

uint MapTag

The tag used in the enclosing message to indicate map entries.

Public functions

Codec

 Codec(
  FieldCodec< TKey > keyCodec,
  FieldCodec< TValue > valueCodec,
  uint mapTag
)

Creates a new entry codec based on a separate key codec and value codec, and the tag to use for each map entry.

Details
Parameters
keyCodec
The key codec.
valueCodec
The value codec.
mapTag
The map tag to use to introduce each map entry.