Package org.passay

Class PasswordUtils


  • public final class PasswordUtils
    extends Object
    Provides utility methods for this package.
    Author:
    Middleware Services
    • Method Detail

      • getMatchingCharacters

        public static String getMatchingCharacters​(String characters,
                                                   String input)
        Returns all the characters in the input string that are also in the characters array.
        Parameters:
        characters - that contains characters to match
        input - to search for matches
        Returns:
        matching characters or empty string
      • getMatchingCharacters

        public static String getMatchingCharacters​(String characters,
                                                   String input,
                                                   int maximumLength)
        Returns all the characters in the input string that are also in the characters string.
        Parameters:
        characters - that contains characters to match
        input - to search for matches
        maximumLength - maximum length of matching characters
        Returns:
        matching characters or empty string
      • countMatchingCharacters

        public static int countMatchingCharacters​(String characters,
                                                  String input)
        Returns the number of characters in the supplied input that existing from the supplied characters string.
        Parameters:
        characters - that contains characters to match
        input - to search for matches
        Returns:
        character count
      • concatArrays

        public static char[] concatArrays​(char[] first,
                                          char[]... rest)
        Concatenates multiple character arrays together.
        Parameters:
        first - array to concatenate. Cannot be null.
        rest - of the arrays to concatenate. May be null.
        Returns:
        array containing the concatenation of all parameters