public class MediaPackageReferenceImpl extends Object implements MediaPackageReference
MediaPackageReference.| Modifier and Type | Class and Description |
|---|---|
static class |
MediaPackageReferenceImpl.Adapter |
| Modifier and Type | Field and Description |
|---|---|
static MediaPackageReference |
ANY_MEDIAPACKAGE
Convenience reference that matches any media package
|
static MediaPackageReference |
ANY_SERIES
Convenience reference that matches any series
|
protected String |
identifier
The reference identifier
|
static MediaPackageReference |
SELF_MEDIAPACKAGE
Convenience reference that matches the current media package
|
protected String |
type
The reference type
|
ANY, SELF, TYPE_ATTACHMENT, TYPE_CATALOG, TYPE_MEDIAPACKAGE, TYPE_SERIES, TYPE_TRACK| Constructor and Description |
|---|
MediaPackageReferenceImpl()
Creates a reference to the containing media package (
self). |
MediaPackageReferenceImpl(MediaPackage mediaPackage)
Creates a reference to the specified media package.
|
MediaPackageReferenceImpl(MediaPackageElement mediaPackageElement)
Creates a reference to the specified media package element.
|
MediaPackageReferenceImpl(String type,
String identifier)
Creates a reference to the entity identified by
type and identifier. |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Returns a deep copy of this reference.
|
boolean |
equals(Object obj) |
static MediaPackageReference |
fromString(String reference)
Returns a media package reference from the given string.
|
String |
getIdentifier()
Returns the reference identifier.
|
Map<String,String> |
getProperties()
Returns additional properties that further define what the object is referencing.
|
String |
getProperty(String key)
Returns the property with name
key or null if no such property exists. |
String |
getType()
Returns the reference type.
|
int |
hashCode() |
boolean |
matches(MediaPackageReference reference)
Returns
true if this reference matches reference by means of type and identifier. |
void |
setProperties(Map<String,String> properties) |
void |
setProperty(String key,
String value)
Adds an additional property to further define the object reference.
|
String |
toString() |
public static final MediaPackageReference ANY_MEDIAPACKAGE
public static final MediaPackageReference SELF_MEDIAPACKAGE
public static final MediaPackageReference ANY_SERIES
protected String identifier
protected String type
public MediaPackageReferenceImpl()
self).public MediaPackageReferenceImpl(MediaPackage mediaPackage)
mediaPackage - the media package to refer topublic MediaPackageReferenceImpl(MediaPackageElement mediaPackageElement)
Note that the referenced element must already be part of the media package, otherwise a
MediaPackageException will be thrown as the object holding this reference is added to the media
package.
mediaPackageElement - the media package element to refer topublic static MediaPackageReference fromString(String reference) throws IllegalArgumentException
IllegalArgumentException - if the string is malformedpublic String getIdentifier()
MediaPackageReference
The identifier will usually refer to the id of the media package element, should the reference point to an element
inside the media package (see MediaPackageElement.getIdentifier()).
In case of a reference to another media package, this will reflect the media package id (see
MediaPackage.getIdentifier()) or self if it refers to the parent media package.
getIdentifier in interface MediaPackageReferenceMediaPackageReference.getIdentifier()public String getType()
MediaPackageReferenceThere is a list of well known types describing media package elements:
mediapackage a reference to the parent media packagetrack referes to a track inside the media packagecatalog referes to a catalog inside the media packageattachment referes to an attachment inside the media packageseries referes to a seriesgetType in interface MediaPackageReferenceMediaPackageReference.getType()public Map<String,String> getProperties()
MediaPackageReferenceAn example would be the point in time for a slide preview:
<attachment ref="track:track-7;time=8764"> </attachment>
getProperties in interface MediaPackageReferencepublic void setProperties(Map<String,String> properties)
properties - the properties to setpublic String getProperty(String key)
key or null if no such property exists.getProperty in interface MediaPackageReferencekey - the property nameMediaPackageReference.getProperty(java.lang.String)public void setProperty(String key, String value)
setProperty in interface MediaPackageReferencekey - The unique keyvalue - The value of the propertyMediaPackageReference.setProperty(java.lang.String, java.lang.String)public boolean matches(MediaPackageReference reference)
MediaPackageReferencetrue if this reference matches reference by means of type and identifier.matches in interface MediaPackageReferencereference - the media package referencetrue if the reference matchesMediaPackageReference.matches(org.opencastproject.mediapackage.MediaPackageReference)public Object clone()
clone in interface MediaPackageReferenceclone in class ObjectObject.clone()public int hashCode()
hashCode in class ObjectObject.hashCode()public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public String toString()
toString in class ObjectObject.toString()Copyright © 2009–2021 Opencast Project. All rights reserved.