Class DictionaryBuilder

java.lang.Object
me.gosimple.nbvcxz.resources.DictionaryBuilder

public class DictionaryBuilder
extends java.lang.Object
Dictionary builder class to help properly build dictionaries.
  • Constructor Details

  • Method Details

    • setDictionaryName

      public DictionaryBuilder setDictionaryName​(java.lang.String dictionary_name)
      Set the dictionary name
      Parameters:
      dictionary_name - unique name of dictionary.
      Returns:
      the builder
    • setExclusion

      public DictionaryBuilder setExclusion​(boolean exclusion)
      Set if exclusion dictionary or not.
      Parameters:
      exclusion - true when desiring to disallow any password contained in this dictionary; false otherwise.
      Returns:
      the builder
    • addWord

      public DictionaryBuilder addWord​(java.lang.String word, int rank)
      Add word to dictionary.
      Parameters:
      word - key to add to the dictionary, will be lowercased.
      rank - the rank of the word in the dictionary. Should increment from most common to least common if ranked. If unranked, an example would be if there were 500 values in the dictionary, every word should have a rank of 250. If exclusion dictionary, rank is unimportant (set to 0).
      Returns:
      the builder
    • addWords

      public DictionaryBuilder addWords​(java.util.Collection<java.lang.String> words, int rank)
      Add a Collection of words to dictionary. All words will be added to dictionary using the same rank.
      Parameters:
      words - the collection of keys to be added to dictionary
      rank - the rank of the word in the dictionary. Should increment from most common to least common if ranked. If unranked, an example would be if there were 500 values in the dictionary, every word should have a rank of 250. If exclusion dictionary, rank is unimportant (set to 0).
      Returns:
      the builder
    • createDictionary

      public Dictionary createDictionary()
      Creates the dictionary.
      Returns:
      the dictionary