Class SimplePersonName.Builder

java.lang.Object
com.ibm.icu.text.SimplePersonName.Builder
Enclosing class:
SimplePersonName

public static class SimplePersonName.Builder extends Object
A utility class for constructing a SimplePersonName. Use SimplePersonName.builder() to get a new Builder instance.
  • Method Details

    • setLocale

      public SimplePersonName.Builder setLocale(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

      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.