public sealed class GeneratedCodeInfo.Types.Annotation : IMessage<GeneratedCodeInfo.Types.Annotation>, IEquatable<GeneratedCodeInfo.Types.Annotation>, IDeepCloneable<GeneratedCodeInfo.Types.Annotation>, IBufferMessage, IMessage
Identifies the ending offset in bytes in the generated code that
relates to the identified object. The end offset should be one past
the last relevant byte (so the length of the text = end - begin).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis document provides detailed information about the \u003ccode\u003eGeneratedCodeInfo.Types.Annotation\u003c/code\u003e class, which is part of the \u003ccode\u003eGoogle.Protobuf.Reflection\u003c/code\u003e namespace in the Google.Protobuf library.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGeneratedCodeInfo.Types.Annotation\u003c/code\u003e implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, providing functionality for message manipulation, equality checks, deep cloning, and efficient buffer usage.\u003c/p\u003e\n"],["\u003cp\u003eThe class contains fields such as \u003ccode\u003eBeginFieldNumber\u003c/code\u003e, \u003ccode\u003eEndFieldNumber\u003c/code\u003e, \u003ccode\u003ePathFieldNumber\u003c/code\u003e, \u003ccode\u003eSemanticFieldNumber\u003c/code\u003e, and \u003ccode\u003eSourceFileFieldNumber\u003c/code\u003e, which are used as constants for identifying specific parts of the generated code.\u003c/p\u003e\n"],["\u003cp\u003eKey properties include \u003ccode\u003eBegin\u003c/code\u003e and \u003ccode\u003eEnd\u003c/code\u003e for identifying byte offsets, \u003ccode\u003ePath\u003c/code\u003e for locating elements in the source \u003ccode\u003e.proto\u003c/code\u003e file, \u003ccode\u003eSemantic\u003c/code\u003e for semantic details, and \u003ccode\u003eSourceFile\u003c/code\u003e for the source file's path, with properties like \u003ccode\u003eHasBegin\u003c/code\u003e, \u003ccode\u003eHasEnd\u003c/code\u003e, \u003ccode\u003eHasSemantic\u003c/code\u003e, and \u003ccode\u003eHasSourceFile\u003c/code\u003e to check if fields are set.\u003c/p\u003e\n"],["\u003cp\u003eConstructors, such as the default \u003ccode\u003eAnnotation()\u003c/code\u003e and the copy constructor \u003ccode\u003eAnnotation(Annotation)\u003c/code\u003e, along with methods like \u003ccode\u003eClone()\u003c/code\u003e, \u003ccode\u003eEquals()\u003c/code\u003e, \u003ccode\u003eMergeFrom()\u003c/code\u003e, \u003ccode\u003eWriteTo()\u003c/code\u003e and more, allow for object creation, manipulation, merging, and serialization, additionally, extension methods are provided for enhanced functionality like merging, serialization and writing.\u003c/p\u003e\n"]]],[],null,["# Class GeneratedCodeInfo.Types.Annotation (3.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [3.27.1 (latest)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation)\n- [3.23.0](/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation)\n- [3.15.8](/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation) \n\n public sealed class GeneratedCodeInfo.Types.Annotation : IMessage\u003cGeneratedCodeInfo.Types.Annotation\u003e, IEquatable\u003cGeneratedCodeInfo.Types.Annotation\u003e, IDeepCloneable\u003cGeneratedCodeInfo.Types.Annotation\u003e, IBufferMessage, IMessage\n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e GeneratedCodeInfo.Types.Annotation \n\nImplements\n----------\n\n[IMessage](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1)[GeneratedCodeInfo](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.GeneratedCodeInfo)[Types](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.GeneratedCodeInfo.Types)[Annotation](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[GeneratedCodeInfo](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.GeneratedCodeInfo)[Types](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.GeneratedCodeInfo.Types)[Annotation](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation), [IDeepCloneable](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1)[GeneratedCodeInfo](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.GeneratedCodeInfo)[Types](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.GeneratedCodeInfo.Types)[Annotation](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.GeneratedCodeInfo.Types.Annotation), [IBufferMessage](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage), [IMessage](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Protobuf.Reflection](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection)\n\nAssembly\n--------\n\nGoogle.Protobuf.dll\n\nConstructors\n------------\n\n### Annotation()\n\n public Annotation()\n\n### Annotation(Annotation)\n\n public Annotation(GeneratedCodeInfo.Types.Annotation other)\n\nFields\n------\n\n### BeginFieldNumber\n\n public const int BeginFieldNumber = 3\n\nField number for the \"begin\" field.\n\n### EndFieldNumber\n\n public const int EndFieldNumber = 4\n\nField number for the \"end\" field.\n\n### PathFieldNumber\n\n public const int PathFieldNumber = 1\n\nField number for the \"path\" field.\n\n### SemanticFieldNumber\n\n public const int SemanticFieldNumber = 5\n\nField number for the \"semantic\" field.\n\n### SourceFileFieldNumber\n\n public const int SourceFileFieldNumber = 2\n\nField number for the \"source_file\" field.\n\nProperties\n----------\n\n### Begin\n\n public int Begin { get; set; }\n\nIdentifies the starting offset in bytes in the generated code\nthat relates to the identified object.\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### End\n\n public int End { get; set; }\n\nIdentifies the ending offset in bytes in the generated code that\nrelates to the identified object. The end offset should be one past\nthe last relevant byte (so the length of the text = end - begin).\n\n### HasBegin\n\n public bool HasBegin { get; }\n\nGets whether the \"begin\" field is set\n\n### HasEnd\n\n public bool HasEnd { get; }\n\nGets whether the \"end\" field is set\n\n### HasSemantic\n\n public bool HasSemantic { get; }\n\nGets whether the \"semantic\" field is set\n\n### HasSourceFile\n\n public bool HasSourceFile { get; }\n\nGets whether the \"source_file\" field is set\n\n### Parser\n\n public static MessageParser\u003cGeneratedCodeInfo.Types.Annotation\u003e Parser { get; }\n\n### Path\n\n public RepeatedField\u003cint\u003e Path { get; }\n\nIdentifies the element in the original source .proto file. This field\nis formatted the same as SourceCodeInfo.Location.path.\n\n### Semantic\n\n public GeneratedCodeInfo.Types.Annotation.Types.Semantic Semantic { get; set; }\n\n### SourceFile\n\n public string SourceFile { get; set; }\n\nIdentifies the filesystem path to the original source .proto.\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\nCalculates the size of this message in Protocol Buffer wire format, in bytes.\n\n### ClearBegin()\n\n public void ClearBegin()\n\nClears the value of the \"begin\" field\n\n### ClearEnd()\n\n public void ClearEnd()\n\nClears the value of the \"end\" field\n\n### ClearSemantic()\n\n public void ClearSemantic()\n\nClears the value of the \"semantic\" field\n\n### ClearSourceFile()\n\n public void ClearSourceFile()\n\nClears the value of the \"source_file\" field\n\n### Clone()\n\n public GeneratedCodeInfo.Types.Annotation Clone()\n\nCreates a deep clone of this object.\n\n### Equals(Annotation)\n\n public bool Equals(GeneratedCodeInfo.Types.Annotation other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\nMerges the data from the specified coded input stream with the current message.\n\n**Remarks** \nSee the user guide for precise merge semantics.\n\n### MergeFrom(Annotation)\n\n public void MergeFrom(GeneratedCodeInfo.Types.Annotation other)\n\nMerges the given message into this one.\n\n**Remarks** \nSee the user guide for precise merge semantics.\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)\n\nWrites the data to the given coded output stream.\n\nExtension Methods\n-----------------\n\n[MessageExtensions.IsInitialized(IMessage)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_IsInitialized_Google_Protobuf_IMessage_) \n[MessageExtensions.MergeDelimitedFrom(IMessage, Stream)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeDelimitedFrom_Google_Protobuf_IMessage_System_IO_Stream_) \n[MessageExtensions.MergeFrom(IMessage, ByteString)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_Google_Protobuf_ByteString_) \n[MessageExtensions.MergeFrom(IMessage, ReadOnlySequence\\\u003cbyte\\\u003e)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_System_Buffers_ReadOnlySequence_System_Byte__) \n[MessageExtensions.MergeFrom(IMessage, byte\\[\\])](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_System_Byte___) \n[MessageExtensions.MergeFrom(IMessage, byte\\[\\], int, int)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_System_Byte___System_Int32_System_Int32_) \n[MessageExtensions.MergeFrom(IMessage, Stream)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_System_IO_Stream_) \n[MessageExtensions.MergeFrom(IMessage, ReadOnlySpan\\\u003cbyte\\\u003e)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_MergeFrom_Google_Protobuf_IMessage_System_ReadOnlySpan_System_Byte__) \n[MessageExtensions.ToByteArray(IMessage)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_ToByteArray_Google_Protobuf_IMessage_) \n[MessageExtensions.ToByteString(IMessage)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_ToByteString_Google_Protobuf_IMessage_) \n[MessageExtensions.WriteDelimitedTo(IMessage, Stream)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_WriteDelimitedTo_Google_Protobuf_IMessage_System_IO_Stream_) \n[MessageExtensions.WriteTo(IMessage, IBufferWriter\\\u003cbyte\\\u003e)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_WriteTo_Google_Protobuf_IMessage_System_Buffers_IBufferWriter_System_Byte__) \n[MessageExtensions.WriteTo(IMessage, Stream)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_WriteTo_Google_Protobuf_IMessage_System_IO_Stream_) \n[MessageExtensions.WriteTo(IMessage, Span\\\u003cbyte\\\u003e)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageExtensions#Google_Protobuf_MessageExtensions_WriteTo_Google_Protobuf_IMessage_System_Span_System_Byte__)"]]