-
- All Implemented Interfaces:
-
android.os.Parcelable,org.readium.r2.shared.JSONable
public final class Link implements JSONable, Parcelable
Link Object for the Readium Web Publication Manifest. https://readium.org/webpub-manifest/schema/link.schema.json
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLink.Companion
-
Field Summary
Fields Modifier and Type Field Description private final MediaTypemediaTypeprivate final List<String>templateParametersprivate final StringtypeLinkprivate final List<String>relprivate final Stringhrefprivate final Stringtypeprivate final Booleantemplatedprivate final Stringtitleprivate final Set<String>relsprivate final Propertiespropertiesprivate final Integerheightprivate final Integerwidthprivate final Doublebitrateprivate final Doubledurationprivate final List<String>languagesprivate final List<Link>alternatesprivate final List<Link>children
-
Method Summary
Modifier and Type Method Description final MediaTypegetMediaType()final List<String>getTemplateParameters()List of URI template parameter keys, if the Link is templated. final StringgetTypeLink()final List<String>getRel()final StringgetHref()final StringgetType()final BooleangetTemplated()final StringgetTitle()final Set<String>getRels()final PropertiesgetProperties()final IntegergetHeight()final IntegergetWidth()final DoublegetBitrate()final DoublegetDuration()final List<String>getLanguages()final List<Link>getAlternates()final List<Link>getChildren()final LinkexpandTemplate(Map<String, String> parameters)Expands the HREF by replacing URI template variables by the given parameters. final StringtoUrl(String baseUrl)Computes an absolute URL to the link, relative to the given baseUrl. JSONObjecttoJSON()Serializes a Link to its RWPM JSON representation. final LinkaddProperties(Map<String, Object> properties)Makes a copy of this Link after merging in the given additional other properties. -
-
Constructor Detail
-
Link
Link(String href, String type, Boolean templated, String title, Set<String> rels, Properties properties, Integer height, Integer width, Double bitrate, Double duration, List<String> languages, List<Link> alternates, List<Link> children)
- Parameters:
href- URI or URI template of the linked resource.type- MIME type of the linked resource.templated- Indicates that a URI template is used in href.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.
-
-
Method Detail
-
getMediaType
final MediaType getMediaType()
-
getTemplateParameters
final List<String> getTemplateParameters()
List of URI template parameter keys, if the Link is templated.
-
getTypeLink
final String getTypeLink()
-
getTemplated
final Boolean getTemplated()
-
getProperties
final Properties getProperties()
-
getBitrate
final Double getBitrate()
-
getDuration
final Double getDuration()
-
getLanguages
final List<String> getLanguages()
-
getAlternates
final List<Link> getAlternates()
-
getChildren
final List<Link> getChildren()
-
expandTemplate
final Link expandTemplate(Map<String, String> parameters)
Expands the HREF by replacing URI template variables by the given parameters.
See RFC 6570 on URI template.
-
toJSON
JSONObject toJSON()
Serializes a Link to its RWPM JSON representation.
-
addProperties
final Link addProperties(Map<String, Object> properties)
Makes a copy of this Link after merging in the given additional other properties.
-
-
-
-