Class CodeGenerator

java.lang.Object
CodeGenerator

public class CodeGenerator extends Object
  • Constructor Details

    • CodeGenerator

      public CodeGenerator()
      Creates a master code with a random 3 digit lock code and clearance word. Precondition: the first digit of the lock code will never be 0 and the clearance word is picked randomly from a list of words.
    • CodeGenerator

      public CodeGenerator(String lockCode, String clearanceCode)
      Creates a master code with lockCode as the lock code and clearanceCode as the clearance word. This constructor is ideal for testing code.
      Parameters:
      lockCode - - the lock
      clearanceCode - - the clearance word.
  • Method Details

    • getLockCode

      public String getLockCode()
      Returns the value of the lock code
      Returns:
      lock
    • getClearanceWord

      public String getClearanceWord()
      Returns the value of the clearance word
      Returns:
      clearance
    • toString

      public String toString()
      Overrides:
      toString in class Object