org.jboss.portal.common.net.media
Interface MediaTypeMap<V>

All Known Implementing Classes:
MediaTypeMapImpl

public interface MediaTypeMap<V>

A map containing values associated with media types. The map has the capability to map wildcard subtypes (for instance text / *) or the wildcard type (* / *). In order to make the distinction between what the map declares and what it supports it is possible to query the map with resolution or not.

Version:
$Revision: 630 $
Author:
Julien Viet

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.
 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.
 

Method Detail

contains

boolean contains(MediaType mediaType)
                 throws java.lang.IllegalArgumentException
Returns true if the map declares the specified media type.

Parameters:
mediaType - the media type
Returns:
true if the map declares the media type
Throws:
java.lang.IllegalArgumentException - if the argument is null

contains

boolean contains(TypeDef type)
                 throws java.lang.IllegalArgumentException
Returns true if the map declares the specified type. It is equivalent to check if the map contains a wildard subtype of a type.

Parameters:
type - the type
Returns:
true if the map declares the type
Throws:
java.lang.IllegalArgumentException - if the argument is null

contains

boolean contains(MediaType mediaType,
                 V value)
                 throws java.lang.IllegalArgumentException
Returns true if the map declares the specified media type with a specified value.

Parameters:
mediaType - the media type
value - the value
Returns:
true if the map declares the media type and the value
Throws:
java.lang.IllegalArgumentException - if any argument is null

contains

boolean contains(TypeDef type,
                 V value)
                 throws java.lang.IllegalArgumentException
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.

Parameters:
type - the type
value - the value
Returns:
true if the map declares the media type and the value
Throws:
java.lang.IllegalArgumentException - if any argument is null

contains

boolean contains(V value)
                 throws java.lang.IllegalArgumentException
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.

Parameters:
value - the value
Returns:
true if the map declares the value
Throws:
java.lang.IllegalArgumentException - if any argument is null

get

java.util.Set<V> get(MediaType mediaType)
                     throws java.lang.IllegalArgumentException
Returns the set of values declared for a given media type.

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

get

java.util.Set<V> get(TypeDef type)
                     throws java.lang.IllegalArgumentException
Returns the set of values declared for a given type.

Parameters:
type - the type
Returns:
the values declared
Throws:
java.lang.IllegalArgumentException - if any argument is null

isSupported

boolean isSupported(MediaType mediaType)
                    throws java.lang.IllegalArgumentException
Returns true if the map supports the specified media type.

Parameters:
mediaType - the media type
Returns:
true if the map supports the media type
Throws:
java.lang.IllegalArgumentException - if the argument is null

isSupported

boolean isSupported(TypeDef type)
                    throws java.lang.IllegalArgumentException
Returns true if the map supports the specified type.

Parameters:
type - the type
Returns:
true if the map declares the type
Throws:
java.lang.IllegalArgumentException - if the argument is null

isSupported

boolean isSupported(MediaType mediaType,
                    V value)
                    throws java.lang.IllegalArgumentException
Returns true if the map supports the specified media type with a specified value.

Parameters:
mediaType - the media type
value - the value
Returns:
true if the map supports the media type and the value
Throws:
java.lang.IllegalArgumentException - if any argument is null

isSupported

boolean isSupported(TypeDef type,
                    V value)
                    throws java.lang.IllegalArgumentException
Returns true if the map supports the specified type with a specific value.

Parameters:
type - the type
value - the value
Returns:
true if the map supports the media type and the value
Throws:
java.lang.IllegalArgumentException - if any argument is null

isSupported

boolean isSupported(V value)
                    throws java.lang.IllegalArgumentException
Returns true if the map supports the specified value for any media type or any type.

Parameters:
value - the value
Returns:
true if the map supports the value
Throws:
java.lang.IllegalArgumentException - if any argument is null

resolve

java.util.Set<V> resolve(MediaType mediaType)
                         throws java.lang.IllegalArgumentException
Returns the set of values supported for a given media type.

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

resolve

java.util.Set<V> resolve(TypeDef type)
                         throws java.lang.IllegalArgumentException
Returns the set of values supported for a given type.

Parameters:
type - the type
Returns:
the values supported
Throws:
java.lang.IllegalArgumentException - if any argument is null

getMediaTypes

java.util.Set<MediaType> getMediaTypes()
Returns the set of declared media types.

Returns:
the media types

getTypes

java.util.Set<TypeDef> getTypes()
Returns the set of declared types.

Returns:
the types

getValues

java.util.Set<V> getValues()
Returns the set of declared values.

Returns:
the values


Copyright © 2008. All Rights Reserved.