PriorityList

data class PriorityList<T>(val ranges: List<Weighted<T>>)(source)

A weighted list of content ranges of type T.

Constructors

Link copied to clipboard
constructor(ranges: List<Weighted<T>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Selects the client's preferred option from a set of options offered by the server, when the range is a SimpleRange

inline fun <Range, Option : Any, OptionId> PriorityList<Range>.preferred(offered: List<Option>, match: (Range, OptionId) -> Boolean, by: (Option) -> OptionId): Option?

Selects the client's preferred option from a set of options offered by the server, matching a priority list against the id of the options.

Link copied to clipboard
fun <T> PriorityList<T>.toHeader(rangeToHeader: (T) -> Pair<String, HeaderParams>): String
Link copied to clipboard