Package org.forgerock.http.header
Class AcceptLanguageHeader
java.lang.Object
org.forgerock.http.protocol.Header
org.forgerock.http.header.AcceptLanguageHeader
A header class representing the Accept-Language HTTP header. String values will include quality
attributes to communicate order of preference expressed in the list of
Locale objects
contained within.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns thePreferredLocalesinstance that represents this header.getName()Returns the name of the header, as it would canonically appear within an HTTP message.Returns the header as a list of strings.static AcceptLanguageHeaderCreate a header from a list of preferredLocalelanguage tags.static AcceptLanguageHeaderCreate a header from a list of preferredLocaleinstances.static AcceptLanguageHeaderCreate a header from a list of header values.static AcceptLanguageHeadervalueOf(PreferredLocales locales) Creates an accept language header representation for aPreferredLocalesinstance.Methods inherited from class org.forgerock.http.protocol.Header
equals, getFirstValue, hashCode, toString
-
Field Details
-
NAME
The name of the header.- See Also:
-
-
Method Details
-
valueOf
Creates an accept language header representation for aPreferredLocalesinstance.- Parameters:
locales- The preferred locales.- Returns:
- The header.
-
valueOf
Create a header from a list of preferredLocaleinstances.- Parameters:
locales- The preferred locales.- Returns:
- The header.
-
valueOf
Create a header from a list of preferredLocalelanguage tags.- Parameters:
languageTags- The preferred locale language tags.- Returns:
- The header.
-
valueOf
Create a header from a list of header values.- Parameters:
headerValues- The Accept-Language header values.- Returns:
- The header.
-
getLocales
Returns thePreferredLocalesinstance that represents this header.- Returns:
- The instance.
-
getName
Description copied from class:HeaderReturns the name of the header, as it would canonically appear within an HTTP message. -
getValues
Description copied from class:HeaderReturns the header as a list of strings. If the header has no values then it must return an empty list, never null. EachStringshould represent the value component of the key-value pair that makes up the HTTP header - as such, for someHeaderimplementations each String in thisListmay contain multiple token-separated values.The
Listreturned from this method should not be expected to be mutable. However, some subclasses ofHeadermay choose to implement it as such.
-