# Class FieldCodec (3.27.1)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [3.27.1 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec)
- [3.23.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.FieldCodec)
- [3.15.8](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.FieldCodec)

    public static class FieldCodec

Factory methods for [FieldCodec\<T\>](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1).

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> FieldCodec

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Protobuf](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf)

## Assembly

Google.Protobuf.dll

## Methods

### ForBool(uint)

    public static FieldCodec<bool> ForBool(uint tag)

Retrieves a codec suitable for a bool field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.boolean` | A codec for the given tag. |

### ForBool(uint, bool)

    public static FieldCodec<bool> ForBool(uint tag, bool defaultValue)

Retrieves a codec suitable for a bool field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.boolean` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.boolean` | A codec for the given tag. |

### ForBytes(uint)

    public static FieldCodec<ByteString> ForBytes(uint tag)

Retrieves a codec suitable for a bytes field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString` | A codec for the given tag. |

### ForBytes(uint, ByteString)

    public static FieldCodec<ByteString> ForBytes(uint tag, ByteString defaultValue)

Retrieves a codec suitable for a bytes field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString` | A codec for the given tag. |

### ForClassWrapper\<T\>(uint)

    public static FieldCodec<T> ForClassWrapper<T>(uint tag) where T : class

Creates a codec for a wrapper type of a class - which must be string or ByteString.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1` |   |

| **Type Parameter** ||
|---|---|
| **Name** | **Description** |
| `T` |   |

### ForDouble(uint)

    public static FieldCodec<double> ForDouble(uint tag)

Retrieves a codec suitable for a double field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.double` | A codec for the given tag. |

### ForDouble(uint, double)

    public static FieldCodec<double> ForDouble(uint tag, double defaultValue)

Retrieves a codec suitable for a double field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.double` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.double` | A codec for the given tag. |

### ForEnum\<T\>(uint, Func\<T, int\>, Func\<int, T\>)

    public static FieldCodec<T> ForEnum<T>(uint tag, Func<T, int> toInt32, Func<int, T> fromInt32)

Retrieves a codec suitable for an enum field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `toInt32` | `https://learn.microsoft.com/dotnet/api/system.func-2https://learn.microsoft.com/dotnet/api/system.int32` A conversion function from [int](https://learn.microsoft.com/dotnet/api/system.int32) to the enum type. |
| `fromInt32` | `https://learn.microsoft.com/dotnet/api/system.func-2https://learn.microsoft.com/dotnet/api/system.int32` A conversion function from the enum type to [int](https://learn.microsoft.com/dotnet/api/system.int32). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1` | A codec for the given tag. |

| **Type Parameter** ||
|---|---|
| **Name** | **Description** |
| `T` |   |

### ForEnum\<T\>(uint, Func\<T, int\>, Func\<int, T\>, T)

    public static FieldCodec<T> ForEnum<T>(uint tag, Func<T, int> toInt32, Func<int, T> fromInt32, T defaultValue)

Retrieves a codec suitable for an enum field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `toInt32` | `https://learn.microsoft.com/dotnet/api/system.func-2https://learn.microsoft.com/dotnet/api/system.int32` A conversion function from [int](https://learn.microsoft.com/dotnet/api/system.int32) to the enum type. |
| `fromInt32` | `https://learn.microsoft.com/dotnet/api/system.func-2https://learn.microsoft.com/dotnet/api/system.int32` A conversion function from the enum type to [int](https://learn.microsoft.com/dotnet/api/system.int32). |
| `defaultValue` | `T` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1` | A codec for the given tag. |

| **Type Parameter** ||
|---|---|
| **Name** | **Description** |
| `T` |   |

### ForFixed32(uint)

    public static FieldCodec<uint> ForFixed32(uint tag)

Retrieves a codec suitable for a fixed32 field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.uint32` | A codec for the given tag. |

### ForFixed32(uint, uint)

    public static FieldCodec<uint> ForFixed32(uint tag, uint defaultValue)

Retrieves a codec suitable for a fixed32 field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.uint32` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.uint32` | A codec for the given tag. |

### ForFixed64(uint)

    public static FieldCodec<ulong> ForFixed64(uint tag)

Retrieves a codec suitable for a fixed64 field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.uint64` | A codec for the given tag. |

### ForFixed64(uint, ulong)

    public static FieldCodec<ulong> ForFixed64(uint tag, ulong defaultValue)

Retrieves a codec suitable for a fixed64 field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.uint64` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.uint64` | A codec for the given tag. |

### ForFloat(uint)

    public static FieldCodec<float> ForFloat(uint tag)

Retrieves a codec suitable for a float field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.single` | A codec for the given tag. |

### ForFloat(uint, float)

    public static FieldCodec<float> ForFloat(uint tag, float defaultValue)

Retrieves a codec suitable for a float field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.single` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.single` | A codec for the given tag. |

### ForGroup\<T\>(uint, uint, MessageParser\<T\>)

    public static FieldCodec<T> ForGroup<T>(uint startTag, uint endTag, MessageParser<T> parser) where T : class, IMessage<T>

Retrieves a codec suitable for a group field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `startTag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The start group tag. |
| `endTag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The end group tag. |
| `parser` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageParser-1` A parser to use for the group message type. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1` | A codec for given tag |

| **Type Parameter** ||
|---|---|
| **Name** | **Description** |
| `T` |   |

### ForInt32(uint)

    public static FieldCodec<int> ForInt32(uint tag)

Retrieves a codec suitable for an int32 field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int32` | A codec for the given tag. |

### ForInt32(uint, int)

    public static FieldCodec<int> ForInt32(uint tag, int defaultValue)

Retrieves a codec suitable for an int32 field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.int32` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int32` | A codec for the given tag. |

### ForInt64(uint)

    public static FieldCodec<long> ForInt64(uint tag)

Retrieves a codec suitable for an int64 field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int64` | A codec for the given tag. |

### ForInt64(uint, long)

    public static FieldCodec<long> ForInt64(uint tag, long defaultValue)

Retrieves a codec suitable for an int64 field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.int64` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int64` | A codec for the given tag. |

### ForMessage\<T\>(uint, MessageParser\<T\>)

    public static FieldCodec<T> ForMessage<T>(uint tag, MessageParser<T> parser) where T : class, IMessage<T>

Retrieves a codec suitable for a message field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `parser` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageParser-1` A parser to use for the message type. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1` | A codec for the given tag. |

| **Type Parameter** ||
|---|---|
| **Name** | **Description** |
| `T` |   |

### ForSFixed32(uint)

    public static FieldCodec<int> ForSFixed32(uint tag)

Retrieves a codec suitable for an sfixed32 field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int32` | A codec for the given tag. |

### ForSFixed32(uint, int)

    public static FieldCodec<int> ForSFixed32(uint tag, int defaultValue)

Retrieves a codec suitable for an sfixed32 field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.int32` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int32` | A codec for the given tag. |

### ForSFixed64(uint)

    public static FieldCodec<long> ForSFixed64(uint tag)

Retrieves a codec suitable for an sfixed64 field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int64` | A codec for the given tag. |

### ForSFixed64(uint, long)

    public static FieldCodec<long> ForSFixed64(uint tag, long defaultValue)

Retrieves a codec suitable for an sfixed64 field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.int64` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int64` | A codec for the given tag. |

### ForSInt32(uint)

    public static FieldCodec<int> ForSInt32(uint tag)

Retrieves a codec suitable for an sint32 field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int32` | A codec for the given tag. |

### ForSInt32(uint, int)

    public static FieldCodec<int> ForSInt32(uint tag, int defaultValue)

Retrieves a codec suitable for an sint32 field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.int32` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int32` | A codec for the given tag. |

### ForSInt64(uint)

    public static FieldCodec<long> ForSInt64(uint tag)

Retrieves a codec suitable for an sint64 field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int64` | A codec for the given tag. |

### ForSInt64(uint, long)

    public static FieldCodec<long> ForSInt64(uint tag, long defaultValue)

Retrieves a codec suitable for an sint64 field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.int64` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.int64` | A codec for the given tag. |

### ForString(uint)

    public static FieldCodec<string> ForString(uint tag)

Retrieves a codec suitable for a string field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.string` | A codec for the given tag. |

### ForString(uint, string)

    public static FieldCodec<string> ForString(uint tag, string defaultValue)

Retrieves a codec suitable for a string field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.string` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.string` | A codec for the given tag. |

### ForStructWrapper\<T\>(uint)

    public static FieldCodec<T?> ForStructWrapper<T>(uint tag) where T : struct

Creates a codec for a wrapper type of a struct - which must be Int32, Int64, UInt32, UInt64,
Bool, Single or Double.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1` |   |

| **Type Parameter** ||
|---|---|
| **Name** | **Description** |
| `T` |   |

### ForUInt32(uint)

    public static FieldCodec<uint> ForUInt32(uint tag)

Retrieves a codec suitable for a uint32 field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.uint32` | A codec for the given tag. |

### ForUInt32(uint, uint)

    public static FieldCodec<uint> ForUInt32(uint tag, uint defaultValue)

Retrieves a codec suitable for a uint32 field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.uint32` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.uint32` | A codec for the given tag. |

### ForUInt64(uint)

    public static FieldCodec<ulong> ForUInt64(uint tag)

Retrieves a codec suitable for a uint64 field with the given tag.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.uint64` | A codec for the given tag. |

### ForUInt64(uint, ulong)

    public static FieldCodec<ulong> ForUInt64(uint tag, ulong defaultValue)

Retrieves a codec suitable for a uint64 field with the given tag.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The tag. |
| `defaultValue` | `https://learn.microsoft.com/dotnet/api/system.uint64` The default value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1https://learn.microsoft.com/dotnet/api/system.uint64` | A codec for the given tag. |