Show / Hide Table of Contents

Class OneofDescriptor

Describes a "oneof" field collection in a message type: a set of fields of which at most one can be set in any particular message.

Inheritance
System.Object
DescriptorBase
OneofDescriptor
Implements
IDescriptor
Inherited Members
DescriptorBase.Index
DescriptorBase.FullName
DescriptorBase.File
DescriptorBase.Declaration
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Protobuf.Reflection
Assembly: Google.Protobuf.dll
Syntax
public sealed class OneofDescriptor : DescriptorBase, IDescriptor

Properties

Accessor

Gets an accessor for reflective access to the values associated with the oneof in a particular message.

Declaration
public OneofAccessor Accessor { get; }
Property Value
Type Description
OneofAccessor

The accessor used for reflective access.

Remarks

In descriptors for generated code, the value returned by this property will always be non-null.

In dynamically loaded descriptors, the value returned by this property will current be null; if and when dynamic messages are supported, it will return a suitable accessor to work with them.

ContainingType

Gets the message type containing this oneof.

Declaration
public MessageDescriptor ContainingType { get; }
Property Value
Type Description
MessageDescriptor

The message type containing this oneof.

CustomOptions

The (possibly empty) set of custom options for this oneof.

Declaration
public CustomOptions CustomOptions { get; }
Property Value
Type Description
CustomOptions

Fields

Gets the fields within this oneof, in declaration order.

Declaration
public IList<FieldDescriptor> Fields { get; }
Property Value
Type Description
System.Collections.Generic.IList<FieldDescriptor>

The fields within this oneof, in declaration order.

Name

The brief name of the descriptor's target.

Declaration
public override string Name { get; }
Property Value
Type Description
System.String
Overrides
DescriptorBase.Name
Back to top