WebLink

class WebLink(val target: String, attributes: List<Pair<String, String?>> = emptyList())(source)

One link of the CoRE Link Format (RFC 6690 §2): a target URI-reference and its attributes in order. An attribute without a value, such as obs (RFC 7641 §6), has a null value. Values are unquoted.

The target stays the text the document had: a link a server sent is peer input, so to use an absolute target as a URI, parse it with CoapUri.parseOrNull.

Constructors

Link copied to clipboard
constructor(target: String, attributes: List<Pair<String, String?>> = emptyList())

Properties

Link copied to clipboard

The attributes in document order; a copy of the list given.

Link copied to clipboard

ct (RFC 7252 §7.2.1); malformed entries are skipped.

Link copied to clipboard

if (RFC 6690 §3.2).

Link copied to clipboard

The obs hint (RFC 7641 §6): the target is useful to observe.

Link copied to clipboard

sz (RFC 6690 §3.3), or null when absent or too big for a Long.

Link copied to clipboard

rt (RFC 6690 §3.1).

Link copied to clipboard
Link copied to clipboard

title (RFC 8288), human readable.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
operator fun get(name: String): String?

The first value of name, or null if absent or a flag.

Link copied to clipboard
fun has(name: String): Boolean

Whether the link has the attribute name, with or without a value.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String

The link in link format.

Link copied to clipboard
fun values(name: String): List<String>

The space-separated values of a relation-type attribute such as rt or if (RFC 6690 §2, §3).