@PublicAPI(stability=VOLATILE, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class NamedCharacterSet extends Object
Constructor and Description |
---|
NamedCharacterSet(String name,
char[] characters)
Creates a new named character set with the provided information.
|
NamedCharacterSet(String name,
char[] characters,
Random random)
Creates a new named character set with the provided information.
|
Modifier and Type | Method and Description |
---|---|
static NamedCharacterSet[] |
decodeCharacterSets(SortedSet<String> values)
Decodes the values of the provided configuration attribute as a
set of character set definitions.
|
String |
encode()
Encodes this character set to a form suitable for use in the
value of a configuration attribute.
|
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.
|
public NamedCharacterSet(String name, char[] characters) throws ConfigException
name
- The name for this character set.characters
- The characters to include in this character
set.ConfigException
- If the provided name contains one or
more illegal characters.public NamedCharacterSet(String name, char[] characters, Random random) throws ConfigException
name
- The name for this character set.characters
- The characters to include in this character
set.random
- The random number generator to use with this
character set.ConfigException
- If the provided name contains one or
more illegal characters.public String getName()
public char[] getCharacters()
public char getRandomCharacter()
public void getRandomCharacters(StringBuilder buffer, int count)
buffer
- The buffer to which the characters should be
appended.count
- The number of characters to append to the
provided buffer.public String encode()
public static NamedCharacterSet[] decodeCharacterSets(SortedSet<String> values) throws ConfigException
values
- The set of encoded character set values to
decode.ConfigException
- If a problem occurs while attempting to
decode the character set definitions.Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.