Class NegotiatedFormat
- java.lang.Object
-
- org.springframework.extensions.webscripts.NegotiatedFormat
-
public final class NegotiatedFormat extends java.lang.ObjectMap between media type and format This class is immutable.- Author:
- davidc
-
-
Constructor Summary
Constructors Constructor Description NegotiatedFormat(MediaType mediaType, java.lang.String format)Construct
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFormat()MediaTypegetMediaType()static java.lang.StringnegotiateFormat(java.lang.String accept, NegotiatedFormat[] negotiatedFormats)Negotiate Format - given a list of accepted media types, return the format that's most suitable
-
-
-
Constructor Detail
-
NegotiatedFormat
public NegotiatedFormat(MediaType mediaType, java.lang.String format)
Construct- Parameters:
mediaType- MediaTypeformat- String
-
-
Method Detail
-
getMediaType
public MediaType getMediaType()
- Returns:
- media type
-
getFormat
public java.lang.String getFormat()
- Returns:
- format
-
negotiateFormat
public static java.lang.String negotiateFormat(java.lang.String accept, NegotiatedFormat[] negotiatedFormats)Negotiate Format - given a list of accepted media types, return the format that's most suitable- Parameters:
accept- comma-seperated list of accepted media typesnegotiatedFormats- list of available formats- Returns:
- most suitable format (or null, if none)
-
-