Package org.opencastproject.mediapackage
Class MediaPackageReferenceImpl
java.lang.Object
org.opencastproject.mediapackage.MediaPackageReferenceImpl
- All Implemented Interfaces:
Cloneable,MediaPackageReference
Default implementation for a
MediaPackageReference.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MediaPackageReferenceConvenience reference that matches any media packageprotected StringThe reference identifierprotected StringThe reference typeFields inherited from interface org.opencastproject.mediapackage.MediaPackageReference
ANY, SELF, TYPE_ATTACHMENT, TYPE_CATALOG, TYPE_MEDIAPACKAGE, TYPE_SERIES, TYPE_TRACK -
Constructor Summary
ConstructorsConstructorDescriptionCreates a reference to the containing media package (self).MediaPackageReferenceImpl(String type, String identifier) Creates a reference to the entity identified bytypeandidentifier.MediaPackageReferenceImpl(MediaPackage mediaPackage) Creates a reference to the specified media package.MediaPackageReferenceImpl(MediaPackageElement mediaPackageElement) Creates a reference to the specified media package element. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a deep copy of this reference.booleanstatic MediaPackageReferencefromString(String reference) Returns a media package reference from the given string.Returns the reference identifier.Returns additional properties that further define what the object is referencing.getProperty(String key) Returns the property with namekeyornullif no such property exists.getType()Returns the reference type.inthashCode()booleanmatches(MediaPackageReference reference) Returnstrueif this reference matchesreferenceby means of type and identifier.voidsetProperties(Map<String, String> properties) voidsetProperty(String key, String value) Adds an additional property to further define the object reference.toString()
-
Field Details
-
ANY_MEDIAPACKAGE
Convenience reference that matches any media package -
identifier
The reference identifier -
type
The reference type
-
-
Constructor Details
-
MediaPackageReferenceImpl
public MediaPackageReferenceImpl()Creates a reference to the containing media package (self). -
MediaPackageReferenceImpl
Creates a reference to the specified media package.- Parameters:
mediaPackage- the media package to refer to
-
MediaPackageReferenceImpl
Creates a reference to the specified media package element.Note that the referenced element must already be part of the media package, otherwise a
MediaPackageExceptionwill be thrown as the object holding this reference is added to the media package.- Parameters:
mediaPackageElement- the media package element to refer to
-
MediaPackageReferenceImpl
Creates a reference to the entity identified bytypeandidentifier.- Parameters:
type- the reference typeidentifier- the reference identifier
-
-
Method Details
-
fromString
Returns a media package reference from the given string.- Returns:
- the media package reference
- Throws:
IllegalArgumentException- if the string is malformed
-
getIdentifier
Description copied from interface:MediaPackageReferenceReturns the reference identifier.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()) orselfif it refers to the parent media package.- Specified by:
getIdentifierin interfaceMediaPackageReference- Returns:
- the reference identifier
- See Also:
-
getType
Description copied from interface:MediaPackageReferenceReturns the reference type.There is a list of well known types describing media package elements:
mediapackagea reference to the parent media packagetrackreferes to a track inside the media packagecatalogreferes to a catalog inside the media packageattachmentreferes to an attachment inside the media packageseriesreferes to a series
- Specified by:
getTypein interfaceMediaPackageReference- Returns:
- the reference type
- See Also:
-
getProperties
Description copied from interface:MediaPackageReferenceReturns additional properties that further define what the object is referencing.An example would be the point in time for a slide preview:
<attachment ref="track:track-7;time=8764"> </attachment>
- Specified by:
getPropertiesin interfaceMediaPackageReference- Returns:
- the properties
-
setProperties
- Parameters:
properties- the properties to set
-
getProperty
Returns the property with namekeyornullif no such property exists.- Specified by:
getPropertyin interfaceMediaPackageReference- Parameters:
key- the property name- Returns:
- the property value
- See Also:
-
setProperty
Adds an additional property to further define the object reference. Set the value to null in order to remove a property.- Specified by:
setPropertyin interfaceMediaPackageReference- Parameters:
key- The unique keyvalue- The value of the property- See Also:
-
matches
Description copied from interface:MediaPackageReferenceReturnstrueif this reference matchesreferenceby means of type and identifier.- Specified by:
matchesin interfaceMediaPackageReference- Parameters:
reference- the media package reference- Returns:
trueif the reference matches- See Also:
-
clone
Returns a deep copy of this reference.- Specified by:
clonein interfaceMediaPackageReference- Overrides:
clonein classObject- Returns:
- the clone
- See Also:
-
hashCode
public int hashCode() -
equals
-
toString
-