Package org.opends.server.types
Class NamedCharacterSet
- java.lang.Object
-
- org.opends.server.types.NamedCharacterSet
-
@PublicAPI(stability=VOLATILE, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class NamedCharacterSet extends Object
This class provides a data structure that makes it possible to associate a name with a given set of characters. The name must consist only of ASCII alphabetic characters.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NamedCharacterSet[]
decodeCharacterSets(SortedSet<String> values)
Decodes the values of the provided configuration attribute as a set of character set definitions.char[]
getCharacters()
Retrieves the characters included in this character set.String
getName()
Retrieves the name for this character set.char
getRandomCharacter()
Retrieves a character at random from this named character set.void
getRandomCharacters(StringBuilder buffer, int count)
Appends the specified number of characters chosen at random from this character set to the provided buffer.
-
-
-
Method Detail
-
getName
public String getName()
Retrieves the name for this character set.- Returns:
- The name for this character set.
-
getCharacters
public char[] getCharacters()
Retrieves the characters included in this character set.- Returns:
- The characters included in this character set.
-
getRandomCharacter
public char getRandomCharacter()
Retrieves a character at random from this named character set.- Returns:
- The randomly-selected character from this named character set;
-
getRandomCharacters
public void getRandomCharacters(StringBuilder buffer, int count)
Appends the specified number of characters chosen at random from this character set to the provided buffer.- Parameters:
buffer
- The buffer to which the characters should be appended.count
- The number of characters to append to the provided buffer.
-
decodeCharacterSets
public static NamedCharacterSet[] decodeCharacterSets(SortedSet<String> values) throws ConfigException
Decodes the values of the provided configuration attribute as a set of character set definitions.- Parameters:
values
- The set of encoded character set values to decode.- Returns:
- The decoded character set definitions.
- Throws:
ConfigException
- If a problem occurs while attempting to decode the character set definitions.
-
-