org.jboss.portal.common.net.media
Class MediaTypeMapImpl<V>

java.lang.Object
  extended by org.jboss.portal.common.net.media.MediaTypeMapImpl<V>
All Implemented Interfaces:
MediaTypeMap<V>

public class MediaTypeMapImpl<V>
extends java.lang.Object
implements MediaTypeMap<V>

An implementation of the media type map interface.

Version:
$Revision: 630 $
Author:
Julien Viet

Constructor Summary
MediaTypeMapImpl()
           
 
Method Summary
 boolean contains(MediaType mediaType)
          Returns true if the map declares the specified media type.
 boolean contains(MediaType mediaType, V value)
          Returns true if the map declares the specified media type with a specified value.
 boolean contains(TypeDef type)
          Returns true if the map declares the specified type.
 boolean contains(TypeDef type, V value)
          Returns true if the map declares the specified type with a specific value.
 boolean contains(V value)
          Returns true if the map declares the specified value for any media type or any type.
 java.util.Set<V> get(MediaType mediaType)
          Returns the set of values declared for a given media type.
 java.util.Set<V> get(TypeDef type)
          Returns the set of values declared for a given type.
 java.util.Set<MediaType> getMediaTypes()
          Returns the set of declared media types.
 java.util.Set<TypeDef> getTypes()
          Returns the set of declared types.
 java.util.Set<V> getValues()
          Returns the set of declared values.
 boolean isSupported(MediaType mediaType)
          Returns true if the map supports the specified media type.
 boolean isSupported(MediaType mediaType, V value)
          Returns true if the map supports the specified media type with a specified value.
 boolean isSupported(TypeDef type)
          Returns true if the map supports the specified type.
 boolean isSupported(TypeDef type, V value)
          Returns true if the map supports the specified type with a specific value.
 boolean isSupported(V value)
          Returns true if the map supports the specified value for any media type or any type.
 void put(MediaType mediaType, V value)
          Adds a value to the map.
 void put(java.lang.String mediaTypePattern, V value)
          Adds a value to the map using a media type pattern.
 void put(TypeDef type, V value)
          Adds a value to the map.
 void put(V value)
          Adds a value to the map.
 java.util.Set<V> resolve(MediaType mediaType)
          Returns the set of values supported for a given media type.
 java.util.Set<V> resolve(TypeDef type)
          Returns the set of values supported for a given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaTypeMapImpl

public MediaTypeMapImpl()
Method Detail

put

public void put(java.lang.String mediaTypePattern,
                V value)
         throws java.lang.IllegalArgumentException
Adds a value to the map using a media type pattern.

Parameters:
mediaTypePattern - the media type pattern
value - the value
Throws:
java.lang.IllegalArgumentException - if any argument is null or the media type pattern is not valid

put

public void put(MediaType mediaType,
                V value)
         throws java.lang.IllegalArgumentException
Adds a value to the map.

Parameters:
mediaType - the media type
value - the value
Throws:
java.lang.IllegalArgumentException - if any argument is null

put

public void put(TypeDef type,
                V value)
         throws java.lang.IllegalArgumentException
Adds a value to the map.

Parameters:
type - the type
value - the value
Throws:
java.lang.IllegalArgumentException - if any argument is null

put

public void put(V value)
Adds a value to the map.

Parameters:
value - the value
Throws:
java.lang.IllegalArgumentException - if any argument is null

resolve

public java.util.Set<V> resolve(MediaType mediaType)
Description copied from interface: MediaTypeMap
Returns the set of values supported for a given media type.

Specified by:
resolve in interface MediaTypeMap<V>
Parameters:
mediaType - the media type
Returns:
the values supported

resolve

public java.util.Set<V> resolve(TypeDef type)
Description copied from interface: MediaTypeMap
Returns the set of values supported for a given type.

Specified by:
resolve in interface MediaTypeMap<V>
Parameters:
type - the type
Returns:
the values supported

get

public java.util.Set<V> get(MediaType mediaType)
Description copied from interface: MediaTypeMap
Returns the set of values declared for a given media type.

Specified by:
get in interface MediaTypeMap<V>
Parameters:
mediaType - the media type
Returns:
the values declared

get

public java.util.Set<V> get(TypeDef type)
Description copied from interface: MediaTypeMap
Returns the set of values declared for a given type.

Specified by:
get in interface MediaTypeMap<V>
Parameters:
type - the type
Returns:
the values declared

getValues

public java.util.Set<V> getValues()
Description copied from interface: MediaTypeMap
Returns the set of declared values.

Specified by:
getValues in interface MediaTypeMap<V>
Returns:
the values

isSupported

public boolean isSupported(MediaType mediaType)
Description copied from interface: MediaTypeMap
Returns true if the map supports the specified media type.

Specified by:
isSupported in interface MediaTypeMap<V>
Parameters:
mediaType - the media type
Returns:
true if the map supports the media type

isSupported

public boolean isSupported(TypeDef type)
Description copied from interface: MediaTypeMap
Returns true if the map supports the specified type.

Specified by:
isSupported in interface MediaTypeMap<V>
Parameters:
type - the type
Returns:
true if the map declares the type

isSupported

public boolean isSupported(MediaType mediaType,
                           V value)
Description copied from interface: MediaTypeMap
Returns true if the map supports the specified media type with a specified value.

Specified by:
isSupported in interface MediaTypeMap<V>
Parameters:
mediaType - the media type
value - the value
Returns:
true if the map supports the media type and the value

isSupported

public boolean isSupported(TypeDef type,
                           V value)
Description copied from interface: MediaTypeMap
Returns true if the map supports the specified type with a specific value.

Specified by:
isSupported in interface MediaTypeMap<V>
Parameters:
type - the type
value - the value
Returns:
true if the map supports the media type and the value

isSupported

public boolean isSupported(V value)
Description copied from interface: MediaTypeMap
Returns true if the map supports the specified value for any media type or any type.

Specified by:
isSupported in interface MediaTypeMap<V>
Parameters:
value - the value
Returns:
true if the map supports the value

contains

public boolean contains(MediaType mediaType)
Description copied from interface: MediaTypeMap
Returns true if the map declares the specified media type.

Specified by:
contains in interface MediaTypeMap<V>
Parameters:
mediaType - the media type
Returns:
true if the map declares the media type

contains

public boolean contains(TypeDef type)
Description copied from interface: MediaTypeMap
Returns true if the map declares the specified type. It is equivalent to check if the map contains a wildard subtype of a type.

Specified by:
contains in interface MediaTypeMap<V>
Parameters:
type - the type
Returns:
true if the map declares the type

contains

public boolean contains(MediaType mediaType,
                        V value)
Description copied from interface: MediaTypeMap
Returns true if the map declares the specified media type with a specified value.

Specified by:
contains in interface MediaTypeMap<V>
Parameters:
mediaType - the media type
value - the value
Returns:
true if the map declares the media type and the value

contains

public boolean contains(TypeDef type,
                        V value)
Description copied from interface: MediaTypeMap
Returns true if the map declares the specified type with a specific value. It is equivalent to check if the map contains a wildard subtype of a type with a specific value.

Specified by:
contains in interface MediaTypeMap<V>
Parameters:
type - the type
value - the value
Returns:
true if the map declares the media type and the value

contains

public boolean contains(V value)
Description copied from interface: MediaTypeMap
Returns true if the map declares the specified value for any media type or any type. It is equivalent to check if the map contains a wildcard type with a specific value.

Specified by:
contains in interface MediaTypeMap<V>
Parameters:
value - the value
Returns:
true if the map declares the value

getMediaTypes

public java.util.Set<MediaType> getMediaTypes()
Description copied from interface: MediaTypeMap
Returns the set of declared media types.

Specified by:
getMediaTypes in interface MediaTypeMap<V>
Returns:
the media types

getTypes

public java.util.Set<TypeDef> getTypes()
Description copied from interface: MediaTypeMap
Returns the set of declared types.

Specified by:
getTypes in interface MediaTypeMap<V>
Returns:
the types


Copyright © 2008. All Rights Reserved.