public class PersonNameFormatter extends Object
REFERRING | ADDRESSING | MONOGRAM | ||||
---|---|---|---|---|---|---|
FORMAL | INFORMAL | FORMAL | INFORMAL | FORMAL | INFORMAL | |
LONG | James Earl Carter Jr. | Jimmy Carter | Mr. Carter | Jimmy | JEC | JC |
MEDIUM | James E. Carter Jr. | Jimmy Carter | Mr. Carter | Jimmy | C | J |
SHORT | J. E. Carter | Jimmy Carter | Mr. Carter | Jimmy | C | J |
Modifier and Type | Class and Description |
---|---|
static class |
PersonNameFormatter.Builder
A utility class that can be used to construct a PersonNameFormatter.
|
static class |
PersonNameFormatter.DisplayOrder
An enum indicating the desired display order for a formatted name.
|
static class |
PersonNameFormatter.Formality
Specifies the intended formality of the formatted name.
|
static class |
PersonNameFormatter.Length
Specifies the desired length of the formatted name.
|
static class |
PersonNameFormatter.Usage
Specifies the intended usage of the formatted name.
|
Constructor and Description |
---|
PersonNameFormatter(Locale locale,
String[] gnFirstPatterns,
String[] snFirstPatterns,
String[] gnFirstLocales,
String[] snFirstLocales)
Deprecated.
This API is for unit testing only.
|
Modifier and Type | Method and Description |
---|---|
static PersonNameFormatter.Builder |
builder()
Returns a Builder object that can be used to construct a new PersonNameFormatter.
|
String |
formatToString(PersonName name)
Formats a name.
|
PersonNameFormatter.Builder |
toBuilder()
Returns a Builder object whose fields match those used to construct this formatter,
allowing a new formatter to be created based on this one.
|
String |
toString()
Deprecated.
This API is for debugging only.
|
public static PersonNameFormatter.Builder builder()
public PersonNameFormatter.Builder toBuilder()
public String formatToString(PersonName name)
name
- A PersonName object that supplies individual field values (optionally, with modifiers applied)
to the formatter for formatting.@Deprecated public String toString()
Copyright © 2016 Unicode, Inc. and others.