Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.neomedia
Enum MediaType

java.lang.Object
  extended by java.lang.Enum<MediaType>
      extended by net.java.sip.communicator.service.neomedia.MediaType
All Implemented Interfaces:
Serializable, Comparable<MediaType>

public enum MediaType
extends Enum<MediaType>

The MediaType enumeration contains a list of media types currently known to and handled by the MediaService.

Author:
Emil Ivov

Enum Constant Summary
AUDIO
          Represents an AUDIO media type.
VIDEO
          Represents a VIDEO media type.
 
Method Summary
static MediaType parseString(String mediaTypeName)
          Returns a MediaType value corresponding to the specified mediaTypeName or in other words MediaType.AUDIO for "audio" and MediaType.VIDEO for "video".
 String toString()
          Returns the name of this MediaType (e.g.
static MediaType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static MediaType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

AUDIO

public static final MediaType AUDIO
Represents an AUDIO media type.


VIDEO

public static final MediaType VIDEO
Represents a VIDEO media type.

Method Detail

values

public static MediaType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MediaType c : MediaType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MediaType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Returns the name of this MediaType (e.g. "audio" or "video"). The name returned by this method is meant for use by session description mechanisms such as SIP/SDP or XMPP/Jingle.

Overrides:
toString in class Enum<MediaType>
Returns:
the name of this MediaType (e.g. "audio" or "video").

parseString

public static MediaType parseString(String mediaTypeName)
                             throws IllegalArgumentException
Returns a MediaType value corresponding to the specified mediaTypeName or in other words MediaType.AUDIO for "audio" and MediaType.VIDEO for "video".

Parameters:
mediaTypeName - the name that we'd like to parse.
Returns:
a MediaType value corresponding to the specified mediaTypeName.
Throws:
IllegalArgumentException - in case mediaTypeName is not a valid or currently supported media type.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.