Package com.ibm.icu.text
Class SimplePersonName.Builder
- java.lang.Object
-
- com.ibm.icu.text.SimplePersonName.Builder
-
- Enclosing class:
- SimplePersonName
public static class SimplePersonName.Builder extends java.lang.Object
A utility class for constructing a SimplePersonName. Use SimplePersonName.builder() to get a new Builder instance.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimplePersonName.Builder
addField(PersonName.NameField field, java.util.Collection<PersonName.FieldModifier> modifiers, java.lang.String value)
Sets the value for one field (with optional modifiers) in the new name object.SimplePersonName
build()
Returns a SimplePersonName with the field values and name locale that were passed to this builder.SimplePersonName.Builder
setLocale(java.util.Locale locale)
Set the locale for the new name object.SimplePersonName.Builder
setPreferredOrder(PersonName.PreferredOrder preferredOrder)
Set the preferred order for the new name object.
-
-
-
Method Detail
-
setLocale
public SimplePersonName.Builder setLocale(java.util.Locale locale)
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
public SimplePersonName.Builder setPreferredOrder(PersonName.PreferredOrder preferredOrder)
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, java.util.Collection<PersonName.FieldModifier> modifiers, java.lang.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
public SimplePersonName 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.
-
-