Share via


StringWithQualityHeaderValueComparer Class

Definition

Implementation of IComparer<T> that can compare content negotiation header fields based on their quality values (a.k.a q-values). This applies to values used in accept-charset, accept-encoding, accept-language and related header fields with similar syntax rules. See MediaTypeHeaderValueComparer for a comparer for media type q-values.

public ref class StringWithQualityHeaderValueComparer : System::Collections::Generic::IComparer<Microsoft::Net::Http::Headers::StringWithQualityHeaderValue ^>
public class StringWithQualityHeaderValueComparer : System.Collections.Generic.IComparer<Microsoft.Net.Http.Headers.StringWithQualityHeaderValue>
type StringWithQualityHeaderValueComparer = class
    interface IComparer<StringWithQualityHeaderValue>
Public Class StringWithQualityHeaderValueComparer
Implements IComparer(Of StringWithQualityHeaderValue)
Inheritance
StringWithQualityHeaderValueComparer
Implements

Properties

QualityComparer

Gets the default instance of StringWithQualityHeaderValueComparer.

Methods

Compare(StringWithQualityHeaderValue, StringWithQualityHeaderValue)

Compares two StringWithQualityHeaderValue based on their quality value (a.k.a their "q-value"). Values with identical q-values are considered equal (i.e the result is 0) with the exception of wild-card values (i.e. a value of "*") which are considered less than non-wild-card values. This allows to sort a sequence of StringWithQualityHeaderValue following their q-values ending up with any wild-cards at the end.

Applies to