Class RandomInputValueGenerator


  • public class RandomInputValueGenerator
    extends Object
    Class for generating random form data.
    Author:
    dannyroest@gmail.com (Danny Roest)
    • Constructor Detail

      • RandomInputValueGenerator

        public RandomInputValueGenerator()
    • Method Detail

      • generate

        private String generate​(int length)
        Parameters:
        length -
        Returns:
        a random string
      • getRandomString

        public String getRandomString​(int length)
        Parameters:
        length - the length of the random string
        Returns:
        random string
      • getRandomNumber

        public String getRandomNumber()
      • getCheck

        public boolean getCheck()
        Returns:
        whether to check with p=0.5
      • getRandomItem

        public <T> T getRandomItem​(List<T> options)
        Parameters:
        options - the possible options (e.g. option item in select). The list must be non-empty
        Returns:
        a random item from the list