public class MediaPackageElementFlavor extends Object implements Cloneable, Comparable<MediaPackageElementFlavor>, Serializable
MediaPackageElements in a semantic way. They reveal or give at least a hint about
the meaning of an element.| Modifier and Type | Field and Description |
|---|---|
static Function<String,MediaPackageElementFlavor> |
parseFlavor |
static String |
WILDCARD
Wildcard character used in type and subtype
|
| Constructor and Description |
|---|
MediaPackageElementFlavor(String type,
String subtype)
Creates a new flavor with the given type and subtype.
|
| Modifier and Type | Method and Description |
|---|---|
MediaPackageElementFlavor |
applyTo(MediaPackageElementFlavor target)
"Applies" this flavor to the given target flavor.
|
MediaPackageElementFlavor |
clone() |
int |
compareTo(MediaPackageElementFlavor m) |
boolean |
eq(String flavor)
Defines equality between flavors and strings.
|
boolean |
equals(Object other) |
static MediaPackageElementFlavor |
flavor(String type,
String subtype)
Constructor function for
MediaPackageElementFlavor(String, String). |
String |
getSubtype()
Returns the subtype of this flavor.
|
String |
getType()
Returns the type of this flavor.
|
int |
hashCode() |
boolean |
matches(MediaPackageElementFlavor other)
Check if two flavors match.
|
static MediaPackageElementFlavor |
parseFlavor(String s)
Creates a new media package element flavor.
|
String |
toString()
Returns the flavor as a string "type/subtype".
|
public static final String WILDCARD
public static final Function<String,MediaPackageElementFlavor> parseFlavor
public static MediaPackageElementFlavor flavor(String type, String subtype)
MediaPackageElementFlavor(String, String).public String getType()
null.
For example, if the type is a presentation movie which is represented as presentation/source,
this method will return presentation.
public String getSubtype()
null.
For example, if the subtype is a presentation movie which is represented as presentation/source,
this method will return source.
public MediaPackageElementFlavor applyTo(MediaPackageElementFlavor target)
target - The target flavor to apply this flavor to.public MediaPackageElementFlavor clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionObject.clone()public boolean eq(String flavor)
flavor - string of the form "type/subtype"public int compareTo(MediaPackageElementFlavor m)
compareTo in interface Comparable<MediaPackageElementFlavor>String.compareTo(java.lang.Object)public String toString()
public static MediaPackageElementFlavor parseFlavor(String s) throws IllegalArgumentException
s - the media package flavorIllegalArgumentException - if the string s does not contain a dash to divide the type from subtype.public boolean matches(MediaPackageElementFlavor other)
other - Flavor to compare againstCopyright © 2009–2020 Opencast Project. All rights reserved.