public class AcceptType extends Object
AcceptType for OData library.
See RFC 7231, chapter 5.3.2:
Accept = #( media-range [ accept-params ] )
media-range = ( "*/*"
/ ( type "/" "*" )
/ ( type "/" subtype )
) *( OWS ";" OWS parameter )
accept-params = weight *( accept-ext )
accept-ext = OWS ";" OWS token [ "=" ( token / quoted-string ) ]
weight = OWS ";" OWS "q=" qvalue
qvalue = ( "0" [ "." 0*3DIGIT ] ) / ( "1" [ "." 0*3("0") ] )
Once created a AcceptType is IMMUTABLE.| Modifier and Type | Method and Description |
|---|---|
static List<AcceptType> |
create(String format)
Create a list of
AcceptType objects based on given input string (format). |
Map<String,String> |
getParameters() |
Float |
getQuality() |
String |
getSubtype() |
String |
getType() |
boolean |
matches(ContentType contentType)
Determines whether this accept type matches a given content type.
|
String |
toString() |
public static List<AcceptType> create(String format)
AcceptType objects based on given input string (format).format - accept types, comma-separated, as specified for the HTTP header AcceptAcceptType objectsIllegalArgumentException - if input string is not parseablepublic String getType()
public String getSubtype()
public Float getQuality()
public boolean matches(ContentType contentType)
Determines whether this accept type matches a given content type.
A match is defined as fulfilling all of the following conditions:
contentType - Copyright © 2013–2014 The Apache Software Foundation. All rights reserved.