public class MediaTypeMap<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MediaTypeMap.CachedMediaTypeAndClass |
static interface |
MediaTypeMap.Typed |
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 and Description |
---|
MediaTypeMap() |
MediaTypeMap(MediaTypeMap<T> mediaTypeMap) |
Modifier and Type | Method and Description |
---|---|
void |
add(MediaType type,
T obj)
Add an object to the media type map.
|
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) |
public static Pattern COMPOSITE_SUBTYPE_WILDCARD_PATTERN
public static Pattern WILD_SUBTYPE_COMPOSITE_PATTERN
public static boolean useCache
public MediaTypeMap()
public MediaTypeMap(MediaTypeMap<T> mediaTypeMap)
public Map<MediaTypeMap.CachedMediaTypeAndClass,List<T>> getClassCache()
public void add(MediaType type, T obj)
type
- media typeobj
- objectpublic List<T> getPossible(MediaType accept)
accept
- mime to matchCopyright © 2021 JBoss by Red Hat. All rights reserved.