public static class LocalePriorityList.Builder extends Object
Modifier and Type | Method and Description |
---|---|
LocalePriorityList.Builder |
add(LocalePriorityList list)
Adds locales with weights.
|
LocalePriorityList.Builder |
add(String acceptLanguageList)
Parses the RFC 2616 string, and adds locales with weights accordingly.
|
LocalePriorityList.Builder |
add(ULocale... locales)
Adds locales, each with weight 1.0.
|
LocalePriorityList.Builder |
add(ULocale locale)
Adds a locale with weight 1.0.
|
LocalePriorityList.Builder |
add(ULocale locale,
double weight)
Adds a locale with a specified weight.
|
LocalePriorityList |
build()
Creates a LocalePriorityList.
|
LocalePriorityList |
build(boolean preserveWeights)
Creates a LocalePriorityList.
|
public LocalePriorityList build()
Builder.build(false)
.public LocalePriorityList build(boolean preserveWeights)
preserveWeights
- when true, each locale's given weight is preserved.public LocalePriorityList.Builder add(LocalePriorityList list)
list
- list of locales with weightspublic LocalePriorityList.Builder add(ULocale locale)
locale
- to add with weight 1.0public LocalePriorityList.Builder add(ULocale... locales)
locales
- locales/languages to be addedpublic LocalePriorityList.Builder add(ULocale locale, double weight)
locale
- language/locale to addweight
- value between 0.0 and 1.1public LocalePriorityList.Builder add(String acceptLanguageList)
acceptLanguageList
- in RFC 2616 format (leniently parsed)Copyright © 2016 Unicode, Inc. and others.