Package com.ibm.icu.text
Class SimplePersonName.Builder
java.lang.Object
com.ibm.icu.text.SimplePersonName.Builder
- Enclosing class:
SimplePersonName
A utility class for constructing a SimplePersonName. Use SimplePersonName.builder()
to get a new Builder instance.
-
Method Summary
Modifier and TypeMethodDescriptionaddField
(PersonName.NameField field, Collection<PersonName.FieldModifier> modifiers, String value) Sets the value for one field (with optional modifiers) in the new name object.build()
Returns a SimplePersonName with the field values and name locale that were passed to this builder.Set the locale for the new name object.setPreferredOrder
(PersonName.PreferredOrder preferredOrder) Set the preferred order for the new name object.
-
Method Details
-
setLocale
Set the locale for the new name object.- Parameters:
locale
- The locale for the new name object. Can be null, which indicates the name's locale is unknown.- Returns:
- This builder.
-
setPreferredOrder
Set the preferred order for the new name object.- Parameters:
preferredOrder
- The preferred order for the new name object.- Returns:
- This builder.
-
addField
public SimplePersonName.Builder addField(PersonName.NameField field, Collection<PersonName.FieldModifier> modifiers, String value) Sets the value for one field (with optional modifiers) in the new name object.- Parameters:
field
- A NameField object specifying the field to set.modifiers
- A collection of FieldModifier objects for any modifiers that apply to this field value. May be null, which is the same as the empty set.value
- The value for this field.- Returns:
- This builder.
-
build
Returns a SimplePersonName with the field values and name locale that were passed to this builder.- Returns:
- A SimplePersonName with the field values and name locale that were passed to this builder.
-