Link

data class Link(val href: Href, val mediaType: MediaType? = null, val title: String? = null, val rels: Set<String> = setOf(), val properties: Properties = Properties(), val height: Int? = null, val width: Int? = null, val bitrate: Double? = null, val duration: Double? = null, val languages: List<String> = listOf(), val alternates: List<Link> = listOf(), val children: List<Link> = listOf()) : JSONable, Parcelable

Link Object for the Readium Web Publication Manifest. https://readium.org/webpub-manifest/schema/link.schema.json

Parameters

href

URI or URI template of the linked resource.

mediaType

Media type of the linked resource.

title

Title of the linked resource.

rels

Relation between the linked resource and its containing collection.

properties

Properties associated to the linked resource.

height

Height of the linked resource in pixels.

width

Width of the linked resource in pixels.

bitrate

Bitrate of the linked resource in kbps.

duration

Length of the linked resource in seconds.

languages

Expected language of the linked resource (BCP 47 tag).

alternates

Alternate resources for the linked resource.

children

Resources that are children of the linked resource, in the context of a given collection role.

Constructors

Link copied to clipboard
constructor(href: Href, mediaType: MediaType? = null, title: String? = null, rels: Set<String> = setOf(), properties: Properties = Properties(), height: Int? = null, width: Int? = null, bitrate: Double? = null, duration: Double? = null, languages: List<String> = listOf(), alternates: List<Link> = listOf(), children: List<Link> = listOf())
constructor(href: Url, mediaType: MediaType? = null, title: String? = null, rels: Set<String> = setOf(), properties: Properties = Properties(), alternates: List<Link> = listOf(), children: List<Link> = listOf())

Convenience constructor for a Link with a Url as href.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val height: Int?
Link copied to clipboard
val href: Href
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val width: Int?

Functions

Link copied to clipboard
fun addProperties(properties: Map<String, Any>): Link

Makes a copy of this Link after merging in the given additional other properties.

Link copied to clipboard
fun Link.copy(transformer: ManifestTransformer): Link
Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard

Returns a copy of the receiver after normalizing its HREFs to the given baseUrl.

Link copied to clipboard
open override fun toJSON(): JSONObject

Serializes a Link to its RWPM JSON representation.

Link copied to clipboard
fun url(base: Url? = null, parameters: Map<String, String> = emptyMap()): Url

Returns the URL represented by this link's HREF, resolved to the given base URL.

Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)