Package org.passay.generate
Class CharacterRuleAppender
java.lang.Object
org.passay.generate.CharacterRuleAppender
- All Implemented Interfaces:
CharacterAppender
Character appender for
CharacterRule.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final UnicodeStringValid characters.private final intNumber of characters.private final RandomTo select random characters. -
Constructor Summary
ConstructorsConstructorDescriptionCharacterRuleAppender(CharacterRule rule, UnicodeString allowedChars, UnicodeString illegalChars, Random rand) Creates a new character rule appender. -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(CharBuffer target, int count) Fills the target buffer with at most count characters from this appender.Returns the characters that may be used in by this appender.
-
Field Details
-
numberOfCharacters
private final int numberOfCharactersNumber of characters. -
characters
Valid characters. -
random
To select random characters.
-
-
Constructor Details
-
CharacterRuleAppender
public CharacterRuleAppender(CharacterRule rule, UnicodeString allowedChars, UnicodeString illegalChars, Random rand) Creates a new character rule appender.- Parameters:
rule- to build appender fromallowedChars- characters allowed for appendingillegalChars- characters not allowed for appendingrand- to randomize character selection
-
-
Method Details
-
getCharacters
Description copied from interface:CharacterAppenderReturns the characters that may be used in by this appender.- Specified by:
getCharactersin interfaceCharacterAppender- Returns:
- valid characters
-
append
Description copied from interface:CharacterAppenderFills the target buffer with at most count characters from this appender.- Specified by:
appendin interfaceCharacterAppender- Parameters:
target- buffer to add characters tocount- maximum number of characters to add to buffer
-