public class MediaType extends Object implements Comparable<MediaType>
Modifier and Type | Field and Description |
---|---|
private com.google.common.net.MediaType |
delegate |
private static com.google.common.collect.ImmutableListMultimap<String,String> |
EMPTY_MULTI_MAP |
private static String |
QUALITY_PARAMETER |
private static String |
WILDCARD_TYPE |
Modifier | Constructor and Description |
---|---|
|
MediaType()
Constructs a
*/* media type. |
private |
MediaType(com.google.common.net.MediaType mediaType) |
|
MediaType(String type)
Constructs a
type/* media type. |
|
MediaType(String type,
String subtype)
Constructs a
type/subtype media type. |
|
MediaType(String type,
String subtype,
com.google.common.collect.Multimap<String,String> parameters)
Constructs a media type using the supplied parameters.
|
|
MediaType(String type,
String subtype,
String parameter,
String parameterValue)
Constructs a
type/subtype;parameter="name" media type. |
private static final String WILDCARD_TYPE
private static final String QUALITY_PARAMETER
private static final com.google.common.collect.ImmutableListMultimap<String,String> EMPTY_MULTI_MAP
private final com.google.common.net.MediaType delegate
public MediaType()
*/*
media type.public MediaType(String type)
type/*
media type.type
- the type (may be null
for a wild card)public MediaType(String type, String subtype)
type/subtype
media type.type
- the type (may be null
for a wild card)subtype
- the subtype (may be null
for a wild card)public MediaType(String type, String subtype, String parameter, String parameterValue)
type/subtype;parameter="name"
media type.type
- the type (may be null
for a wild card)subtype
- the subtype (may be null
for a wild card)parameter
- the parameterparameterValue
- the parameter valuepublic MediaType(String type, String subtype, com.google.common.collect.Multimap<String,String> parameters)
type
- the type (may be null
for a wild card)subtype
- the subtype (may be null
for a wild card)parameters
- the parameter mapprivate MediaType(com.google.common.net.MediaType mediaType)
public String getType()
public String getSubtype()
public boolean isWildcard()
public boolean isWildcardType()
public boolean isWildcardSubtype()
public boolean isCompatible(MediaType other)
public boolean hasParameter(String parameter)
public float getQuality()
public boolean hasParameters()
public MediaType withParameters(com.google.common.collect.Multimap<String,String> parameters)
public MediaType withoutQuality()
public MediaType withoutParameters()
public int compareTo(MediaType o)
compareTo
in interface Comparable<MediaType>
public static String normalizeString(String string)
string
- Mime type string to normalizeprivate com.google.common.net.MediaType getDelegate()
Copyright © 2012-2014 52north.org. All Rights Reserved.