Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class Microsoft.​Net.​Http.​Headers.​StringWithQualityHeaderValueComparer

Assembly: Microsoft.Net.Http.Headers

Inheritance: object → StringWithQualityHeaderValueComparer

Implemented Interfaces

Implementation of <see cref="T:System.Collections.Generic.IComparer`1" /> 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 <see cref="T:Microsoft.Net.Http.Headers.MediaTypeHeaderValueComparer" /> for a comparer for media type q-values.

Properties

QualityComparer
Gets the default instance of <see cref="T:Microsoft.Net.Http.Headers.StringWithQualityHeaderValueComparer" /> .

Methods

public int
Compare​(StringWithQualityHeaderValue stringWithQuality1, StringWithQualityHeaderValue stringWithQuality2)
Compares two <see cref="T:Microsoft.Net.Http.Headers.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 <see cref="T:Microsoft.Net.Http.Headers.StringWithQualityHeaderValue" /> following their q-values ending up with any wild-cards at the end.
Returns The result of the comparison.
stringWithQuality1 The first value to compare.
stringWithQuality2 The second value to compare
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object