Class MetadataDefinition
Represents a piece of metadata to extract by querying a source.
Implements
Inherited Members
Namespace: CrashCABN.Metadata
Assembly: CrashCABN.Metadata.Abstractions.dll
Syntax
public sealed record MetadataDefinition : IEquatable<MetadataDefinition>
Constructors
View SourceMetadataDefinition(object?, QueryType, string, string?, AppliesToEnum, string?)
Represents a piece of metadata to extract by querying a source.
Declaration
public MetadataDefinition(object? Query, QueryType QueryType, string Name = "", string? Source = null, AppliesToEnum AppliesTo = AppliesToEnum.Both, string? Comment = null)
Parameters
Type | Name | Description |
---|---|---|
object | Query | The query to execute. |
QueryType | QueryType | The query type to use to map the metadata. |
string | Name | The name to use to retrieve the metadata value. |
string | Source | The metadata source, such as a file name. |
AppliesToEnum | AppliesTo | |
string | Comment |
Properties
View SourceAppliesTo
Declaration
[JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Ignore)]
[JsonConverter(typeof(StringEnumConverter))]
public AppliesToEnum AppliesTo { get; init; }
Property Value
Type | Description |
---|---|
AppliesToEnum |
Comment
Declaration
[JsonProperty(Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public string? Comment { get; init; }
Property Value
Type | Description |
---|---|
string |
Name
The name to use to retrieve the metadata value.
Declaration
public string Name { get; init; }
Property Value
Type | Description |
---|---|
string |
Query
The query to execute.
Declaration
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public object? Query { get; init; }
Property Value
Type | Description |
---|---|
object |
QueryType
The query type to use to map the metadata.
Declaration
[JsonProperty(Required = Required.Always)]
[JsonConverter(typeof(StringEnumConverter))]
public QueryType QueryType { get; init; }
Property Value
Type | Description |
---|---|
QueryType |
Source
The metadata source, such as a file name.
Declaration
[JsonProperty(Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public string? Source { get; init; }
Property Value
Type | Description |
---|---|
string |
Methods
View SourceEquals(MetadataDefinition?)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(MetadataDefinition? other)
Parameters
Type | Name | Description |
---|---|---|
MetadataDefinition | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |
Overrides
View SourceToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |