public static final class Attributes.Builder extends Object
Builds a collection of format attributes.
| Constructor and Description |
|---|
Attributes.Builder()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Attributes |
build()
Creates a new unmodifiable collection of format attributes.
|
Attributes.Builder |
remove(AttributeKey<?> key)
Removes the specified attribute.
|
<A extends Enum<A>> |
set(AttributeKey<A> key,
A value)
Sets an attribute of
enum-type. |
Attributes.Builder |
set(AttributeKey<Boolean> key,
boolean value)
Sets an attribute of
boolean-type. |
Attributes.Builder |
set(AttributeKey<Character> key,
char value)
Sets an attribute of
char-type. |
Attributes.Builder |
set(AttributeKey<Integer> key,
int value)
Sets an attribute of
int-type. |
Attributes.Builder |
setAll(Attributes attributes)
Accepts all given attributes.
|
Attributes.Builder |
setCalendarType(String calendarType)
Sets the calendar type.
|
Attributes.Builder |
setLanguage(Locale locale)
Sets the language.
|
Attributes.Builder |
setStdTimezone()
Sets the system timezone reference.
|
Attributes.Builder |
setTimezone(String tzid)
Sets the timezone reference.
|
Attributes.Builder |
setTimezone(TZID tzid)
Sets the timezone reference.
|
public Attributes.Builder setCalendarType(String calendarType)
Sets the calendar type.
calendarType - calendar type for resource lookuppublic Attributes.Builder setLanguage(Locale locale)
Sets the language.
locale - new language settingAttributes.LANGUAGEpublic Attributes.Builder setTimezone(TZID tzid)
Sets the timezone reference.
tzid - timezone idAttributes.TIMEZONE_IDpublic Attributes.Builder setTimezone(String tzid)
Sets the timezone reference.
tzid - timezone idIllegalArgumentException - if given timezone cannot be loadedAttributes.TIMEZONE_IDpublic Attributes.Builder setStdTimezone()
Sets the system timezone reference.
Attributes.TIMEZONE_ID,
Timezone.ofSystem()public Attributes.Builder set(AttributeKey<Boolean> key, boolean value)
Sets an attribute of boolean-type.
key - attribute keyvalue - attribute valuepublic Attributes.Builder set(AttributeKey<Integer> key, int value)
Sets an attribute of int-type.
key - attribute keyvalue - attribute valueIllegalArgumentException - if an invalid pivot year is givenpublic Attributes.Builder set(AttributeKey<Character> key, char value)
Sets an attribute of char-type.
key - attribute keyvalue - attribute valuepublic <A extends Enum<A>> Attributes.Builder set(AttributeKey<A> key, A value)
Sets an attribute of enum-type.
A - generic type of attributekey - attribute keyvalue - attribute valuepublic Attributes.Builder setAll(Attributes attributes)
Accepts all given attributes.
If an attribute already exists then it will be overridden.
attributes - format attributespublic Attributes.Builder remove(AttributeKey<?> key)
Removes the specified attribute.
key - attribute key to be removedIllegalArgumentException - if given attribute is internalpublic Attributes build()
Creates a new unmodifiable collection of format attributes.
AttributesCopyright © 2014. All rights reserved.