Package com.ibm.icu.text
Enum PersonNameFormatter.Usage
- java.lang.Object
-
- java.lang.Enum<PersonNameFormatter.Usage>
-
- com.ibm.icu.text.PersonNameFormatter.Usage
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<PersonNameFormatter.Usage>
- Enclosing class:
- PersonNameFormatter
public static enum PersonNameFormatter.Usage extends java.lang.Enum<PersonNameFormatter.Usage>
Specifies the intended usage of the formatted name.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ADDRESSING
Used for when the name is going to be used to address the user directly: "Turn left here, John."MONOGRAM
Used to generate monograms, short 1 to 3-character versions of the name suitable for use in things like chat avatars.REFERRING
Used in general cases, when the name is used to refer to somebody else.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PersonNameFormatter.Usage
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static PersonNameFormatter.Usage[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ADDRESSING
public static final PersonNameFormatter.Usage ADDRESSING
Used for when the name is going to be used to address the user directly: "Turn left here, John."
-
REFERRING
public static final PersonNameFormatter.Usage REFERRING
Used in general cases, when the name is used to refer to somebody else.
-
MONOGRAM
public static final PersonNameFormatter.Usage MONOGRAM
Used to generate monograms, short 1 to 3-character versions of the name suitable for use in things like chat avatars. In English, this is usually the person's initials, but this isn't true in all languages. When the caller specifies Usage.MONOGRAM, the Length parameter can be used to get different lengths of monograms: Length.SHORT is generally a single letter; Length.LONG may be as many as three or four.
-
-
Method Detail
-
values
public static PersonNameFormatter.Usage[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PersonNameFormatter.Usage c : PersonNameFormatter.Usage.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PersonNameFormatter.Usage valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-