<PackageReference Include="Google.Protobuf" Version="3.34.0" />

Google.Protobuf.FieldMaskTree

sealed class FieldMaskTree

A tree representation of a FieldMask. Each leaf node in this tree represent a field path in the FieldMask.

For example, FieldMask "foo.bar,foo.baz,bar.baz" as a tree will be:

[root] -+- foo -+- bar | | | +- baz | +- bar --- baz

By representing FieldMasks with this tree structure we can easily convert a FieldMask to a canonical form, merge two FieldMasks, calculate the intersection to two FieldMasks and traverse all fields specified by the FieldMask in a message tree.

namespace Google.Protobuf { internal sealed class FieldMaskTree { public FieldMaskTree(); public FieldMaskTree(FieldMask mask); public FieldMaskTree AddFieldPath(string path); public FieldMaskTree MergeFromFieldMask(FieldMask mask); public FieldMask ToFieldMask(); public void IntersectFieldPath(string path, FieldMaskTree output); public void Merge(IMessage source, IMessage destination, FieldMask.MergeOptions options); } }