Table of Contents

Class Feature

Namespace
Gve.Text
Assembly
Gve.Text.dll

A generic name=value (or just named) feature.

public record Feature : IEquatable<Feature>
Inheritance
Feature
Implements
Derived
Inherited Members

Constructors

Feature()

Initializes a new instance of the Feature class.

public Feature()

Feature(string, string?, FeatureSetPolicy)

Initializes a new instance of the Feature class.

public Feature(string name, string? value, FeatureSetPolicy setPolicy = FeatureSetPolicy.Multiple)

Parameters

name string

The name.

value string

The value.

setPolicy FeatureSetPolicy

The set policy.

Exceptions

ArgumentNullException

name

Properties

Name

Gets the name.

public string Name { get; init; }

Property Value

string

SetPolicy

The feature set policy.

public FeatureSetPolicy SetPolicy { get; init; }

Property Value

FeatureSetPolicy

Value

Gets the value. Usually there is a value, but in some cases a feature is used just as a flag, in which case the value is null.

public string? Value { get; init; }

Property Value

string

Methods

ToString()

Converts to a parsable string with format NAME=VALUE where operator is = for multiple, := for single, and == for single-first. Value is enclosed in double quotes if it contains white spaces.

public override string ToString()

Returns

string

A string that represents this instance.