Class 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.
    Status:
    Stable ICU 73.
    • Method Detail

      • 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.
        Status:
        Stable ICU 73.
      • 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.
        Status:
        Stable ICU 73.
      • 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.
        Status:
        Stable ICU 73.
      • 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.
        Status:
        Stable ICU 73.