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
-
Method Summary
Modifier and TypeMethodDescriptionReturns thePreferredLocales
instance 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 AcceptLanguageHeader
Create a header from a list of preferredLocale
language tags.static AcceptLanguageHeader
Create a header from a list of preferredLocale
instances.static AcceptLanguageHeader
Create a header from a list of header values.static AcceptLanguageHeader
valueOf
(PreferredLocales locales) Creates an accept language header representation for aPreferredLocales
instance.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 aPreferredLocales
instance.- Parameters:
locales
- The preferred locales.- Returns:
- The header.
-
valueOf
Create a header from a list of preferredLocale
instances.- Parameters:
locales
- The preferred locales.- Returns:
- The header.
-
valueOf
Create a header from a list of preferredLocale
language 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 thePreferredLocales
instance that represents this header.- Returns:
- The instance.
-
getName
Description copied from class:Header
Returns the name of the header, as it would canonically appear within an HTTP message. -
getValues
Description copied from class:Header
Returns the header as a list of strings. If the header has no values then it must return an empty list, never null. EachString
should represent the value component of the key-value pair that makes up the HTTP header - as such, for someHeader
implementations each String in thisList
may contain multiple token-separated values.The
List
returned from this method should not be expected to be mutable. However, some subclasses ofHeader
may choose to implement it as such.
-