Class FieldDescriptorPattern
Defines the pattern matching on field descriptors.
[GenerateKeyedMatchNode]
public record FieldDescriptorPattern : Pattern<IFieldDescriptor>, IEquatable<Pattern>, IEquatable<Pattern<IFieldDescriptor>>, IEquatable<FieldDescriptorPattern>
- Inheritance
-
FieldDescriptorPattern
- Implements
- Inherited Members
Constructors
FieldDescriptorPattern(FieldDescriptorPattern)
protected FieldDescriptorPattern(FieldDescriptorPattern original)
Parameters
originalFieldDescriptorPattern
FieldDescriptorPattern(Pattern<TypeSignature>, Pattern<ITypeDefOrRef?>, Pattern<string?>)
Defines the pattern matching on field descriptors.
public FieldDescriptorPattern(Pattern<TypeSignature> FieldType, Pattern<ITypeDefOrRef?> DeclaringType, Pattern<string?> Name)
Parameters
FieldTypePattern<TypeSignature>The pattern describing the field type.
DeclaringTypePattern<ITypeDefOrRef>The pattern describing the type declaring the field.
NamePattern<string>The pattern describing the name of the field.
Fields
AnyField
Defines the pattern for any valid field descriptor.
public static readonly Pattern<IFieldDescriptor> AnyField
Field Value
Properties
DeclaringType
The pattern describing the type declaring the field.
public Pattern<ITypeDefOrRef?> DeclaringType { get; init; }
Property Value
EqualityContract
protected override Type EqualityContract { get; }
Property Value
FieldType
The pattern describing the field type.
public Pattern<TypeSignature> FieldType { get; init; }
Property Value
Name
The pattern describing the name of the field.
public Pattern<string?> Name { get; init; }
Property Value
Methods
Deconstruct(out Pattern<TypeSignature>, out Pattern<ITypeDefOrRef?>, out Pattern<string?>)
public void Deconstruct(out Pattern<TypeSignature> FieldType, out Pattern<ITypeDefOrRef?> DeclaringType, out Pattern<string?> Name)
Parameters
FieldTypePattern<TypeSignature>DeclaringTypePattern<ITypeDefOrRef>NamePattern<string>
Equals(FieldDescriptorPattern?)
public virtual bool Equals(FieldDescriptorPattern? other)
Parameters
otherFieldDescriptorPattern
Returns
Equals(Pattern<IFieldDescriptor>?)
public override sealed bool Equals(Pattern<IFieldDescriptor>? other)
Parameters
otherPattern<IFieldDescriptor>
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Format(IndentedTextWriter)
Serializes the pattern to a readable string.
public override void Format(IndentedTextWriter writer)
Parameters
writerIndentedTextWriterThe output stream.
GetHashCode()
public override int GetHashCode()
Returns
Match(IFieldDescriptor, MatchingContext)
Attempts to match the provided input to the pattern.
public override IMatchNode<IFieldDescriptor>? Match(IFieldDescriptor input, MatchingContext context)
Parameters
inputIFieldDescriptorThe input to match.
contextMatchingContextThe context in which to match the pattern to.
Returns
- IMatchNode<IFieldDescriptor>
When successful, returns the root node of the match tree, otherwise
null.
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
Operators
operator ==(FieldDescriptorPattern?, FieldDescriptorPattern?)
public static bool operator ==(FieldDescriptorPattern? left, FieldDescriptorPattern? right)
Parameters
leftFieldDescriptorPatternrightFieldDescriptorPattern
Returns
operator !=(FieldDescriptorPattern?, FieldDescriptorPattern?)
public static bool operator !=(FieldDescriptorPattern? left, FieldDescriptorPattern? right)
Parameters
leftFieldDescriptorPatternrightFieldDescriptorPattern