Package org.passay.generate
Class FillRemainingCharactersAppender
java.lang.Object
org.passay.generate.FillRemainingCharactersAppender
- All Implemented Interfaces:
CharacterAppender
Character appender for filling a password with valid characters. This appender should be the last to execute for
password generation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final UnicodeStringValid characters.private final RandomTo select random characters. -
Constructor Summary
ConstructorsConstructorDescriptionFillRemainingCharactersAppender(List<? extends Rule> rules, UnicodeString allowedChars, UnicodeString illegalChars, Random rand) Creates a new fill 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.private UnicodeStringgetCharacters(List<? extends Rule> rules) Return a unicode string that contains the unique characters from allCharacterRuleorCharacterCharacteristicsRulecontained in the supplied list.
-
Field Details
-
characters
Valid characters. -
random
To select random characters.
-
-
Constructor Details
-
FillRemainingCharactersAppender
public FillRemainingCharactersAppender(List<? extends Rule> rules, UnicodeString allowedChars, UnicodeString illegalChars, Random rand) Creates a new fill appender.- Parameters:
rules- to derive characters fromallowedChars- characters allowed for appendingillegalChars- characters not allowed for appendingrand- to randomize character selection
-
-
Method Details
-
getCharacters
Return a unicode string that contains the unique characters from allCharacterRuleorCharacterCharacteristicsRulecontained in the supplied list.- Parameters:
rules- to extract unique characters from- Returns:
- unicode string containing unique characters or empty string
-
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
-