Package org.opencastproject.mediapackage
Class MediaPackageElementFlavor
java.lang.Object
org.opencastproject.mediapackage.MediaPackageElementFlavor
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<MediaPackageElementFlavor>
public class MediaPackageElementFlavor
extends Object
implements Cloneable, Comparable<MediaPackageElementFlavor>, Serializable
ELement flavors describe
MediaPackageElements in a semantic way. They reveal or give at least a hint about
the meaning of an element.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMediaPackageElementFlavor(String type, String subtype) Creates a new flavor with the given type and subtype. -
Method Summary
Modifier and TypeMethodDescriptionapplyTo(MediaPackageElementFlavor target) "Applies" this flavor to the given target flavor.clone()intbooleanDefines equality between flavors and strings.booleanstatic MediaPackageElementFlavorConstructor function forMediaPackageElementFlavor(String, String).Returns the subtype of this flavor.getType()Returns the type of this flavor.inthashCode()booleanmatches(MediaPackageElementFlavor other) Check if two flavors match.static MediaPackageElementFlavorCreates a new media package element flavor.toString()Returns the flavor as a string "type/subtype".
-
Field Details
-
WILDCARD
Wildcard character used in type and subtype- See Also:
-
SEPARATOR
Character that separates both parts of a flavor- See Also:
-
-
Constructor Details
-
MediaPackageElementFlavor
Creates a new flavor with the given type and subtype.- Parameters:
type- the type of the flavorsubtype- the subtype of the flavor
-
-
Method Details
-
flavor
Constructor function forMediaPackageElementFlavor(String, String). -
getType
Returns the type of this flavor. The type is nevernull.For example, if the type is a presentation movie which is represented as
presentation/source, this method will returnpresentation.- Returns:
- the type of this flavor
-
getSubtype
Returns the subtype of this flavor. The subtype is nevernull.For example, if the subtype is a presentation movie which is represented as
presentation/source, this method will returnsource.- Returns:
- the subtype
-
applyTo
"Applies" this flavor to the given target flavor. E.g. applying '*\/preview' to 'presenter/source' yields 'presenter/preview', applying 'presenter/*' to 'foo/source' yields 'presenter/source', and applying 'foo/bar' to 'presenter/source' yields 'foo/bar'.- Parameters:
target- The target flavor to apply this flavor to.- Returns:
- The resulting flavor.
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException- See Also:
-
eq
Defines equality between flavors and strings.- Parameters:
flavor- string of the form "type/subtype"
-
compareTo
- Specified by:
compareToin interfaceComparable<MediaPackageElementFlavor>- See Also:
-
toString
Returns the flavor as a string "type/subtype". -
parseFlavor
Creates a new media package element flavor.- Parameters:
s- the media package flavor- Returns:
- the media package element flavor object
- Throws:
IllegalArgumentException- if the stringsdoes not contain a dash to divide the type from subtype.
-
matches
Check if two flavors match. Two flavors match if both their type and subtype matches.- Parameters:
other- Flavor to compare against- Returns:
- If the flavors match
-
hashCode
public int hashCode() -
equals
-