Added FieldDescriptor.IsExtension and sealed ExtensionCollection
This commit is contained in:
parent
8b7fb7d0f4
commit
8e917d1688
@ -39,7 +39,7 @@ namespace Google.Protobuf.Reflection
|
||||
/// <summary>
|
||||
/// A collection to simplify retrieving the descriptors of extensions in a descriptor for a message
|
||||
/// </summary>
|
||||
public class ExtensionCollection
|
||||
public sealed class ExtensionCollection
|
||||
{
|
||||
private IDictionary<MessageDescriptor, IList<FieldDescriptor>> extensionsByTypeInDeclarationOrder;
|
||||
private IDictionary<MessageDescriptor, IList<FieldDescriptor>> extensionsByTypeInNumberOrder;
|
||||
|
@ -203,6 +203,11 @@ namespace Google.Protobuf.Reflection
|
||||
/// </summary>
|
||||
public bool IsPacked => File.Proto.Syntax == "proto2" ? Proto.Options?.Packed ?? false : !Proto.Options.HasPacked || Proto.Options.Packed;
|
||||
|
||||
/// <summary>
|
||||
/// Returns <c>true</c> if this field extends another message type; <c>false</c> otherwise.
|
||||
/// </summary>
|
||||
public bool IsExtension => Proto.HasExtendee;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the type of the field.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user