org.jboss.resteasy.core

## Class MediaTypeMap<T>

- java.lang.Object
- - org.jboss.resteasy.core.MediaTypeMap<T>

-     public class MediaTypeMap<T>
      extends Object

  efficient MediaType index of T
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `MediaTypeMap.CachedMediaTypeAndClass`
    `static interface` | `MediaTypeMap.Typed`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Pattern` | `COMPOSITE_SUBTYPE_WILDCARD_PATTERN`
    `static boolean` | `useCache` By default, MediaTypeMap will cache possible MediaType/Class matches.
    `static Pattern` | `WILD_SUBTYPE_COMPOSITE_PATTERN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MediaTypeMap()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(MediaType type, T obj)` Add an object to the media type map.
    `MediaTypeMap<T>` | `clone()`
    `Map<MediaTypeMap.CachedMediaTypeAndClass,List<T>>` | `getClassCache()`
    `List<T>` | `getPossible(MediaType accept)` Returns a list of objects sorted based on their media type where the first in the list is the best match
    `List<T>` | `getPossible(MediaType accept, Class type)`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### COMPOSITE_SUBTYPE_WILDCARD_PATTERN

          public static Pattern COMPOSITE_SUBTYPE_WILDCARD_PATTERN

    - #### WILD_SUBTYPE_COMPOSITE_PATTERN

          public static Pattern WILD_SUBTYPE_COMPOSITE_PATTERN

    - #### useCache

          public static boolean useCache

      By default, MediaTypeMap will cache possible MediaType/Class matches. Set this to false to turn off caching

  - ### Constructor Detail

    - #### MediaTypeMap

          public MediaTypeMap()

  - ### Method Detail

    - #### clone

          public MediaTypeMap<T> clone()

      Overrides:
        `clone` in class `Object`

    - #### getClassCache

          public Map<MediaTypeMap.CachedMediaTypeAndClass,List<T>> getClassCache()

    - #### add

          public void add(MediaType type,
                 T obj)

      Add an object to the media type map. This is synchronized to serialize adds.
      Parameters:
        `type` -
        `obj` -

    - #### getPossible

          public List<T> getPossible(MediaType accept)

      Returns a list of objects sorted based on their media type where the first in the list is the best match
      Parameters:
        `accept` - mime to match
      Returns:

    - #### getPossible

          public List<T> getPossible(MediaType accept,
                            Class type)

Copyright © 2014. All Rights Reserved.