Class RandomGenerator


  • public class RandomGenerator
    extends Object
    • Field Detail

      • LANGUAGES

        protected static final String[] LANGUAGES
      • random

        protected static final Random random
    • Method Detail

      • getRandomHour

        public static int getRandomHour()
        Generate a random int between 0 and 23.
        Returns:
        a random int between 0 and 23.
      • getRandomMinutes

        public static int getRandomMinutes()
        Generate a random int between 0 and 59.
        Returns:
        a random int between 0 and 59.
      • getRandomMonth

        public static int getRandomMonth()
        Generate a random int between 0 and 11.
        Returns:
        a random int between 0 and 11.
      • getRandomYear

        public static int getRandomYear()
        Generate a random int between 2019 and 2019.
        Returns:
        a random int between 2019 and 2019.
      • getRandomDay

        public static int getRandomDay()
        Generate a random int between 0 and 31.
        Returns:
        a random int between 0 and 31.
      • getRandomLong

        public static long getRandomLong()
        Generate a random long.
        Returns:
        a random long.
      • getRandomFloat

        public static float getRandomFloat()
        Generate a random float.
        Returns:
        a random float.
      • getRandomString

        public static String getRandomString()
        Generate a random String of size 32.
        Returns:
        a random String of 32 chars.
      • getRandomLanguage

        public static String getRandomLanguage()
        Generate a random language
        Returns:
        a random valid language.
      • getRandomBoolean

        public static boolean getRandomBoolean()
        Generate a random boolean.
        Returns:
        a random boolean.
      • getRandomInt

        public static int getRandomInt()
        Generate a random int.
        Returns:
        a random int.
      • getRandomInt

        public static int getRandomInt​(int max)
        Generate a random int in the 0 inclusive max exclusive.
        Parameters:
        max - the exclusive maximum of the random int.
        Returns:
        a random int.
      • getOutdatedCalendar

        public static Calendar getOutdatedCalendar()
      • getFuturCalendar

        public static Calendar getFuturCalendar()
      • getRandomCalendar

        public static Calendar getRandomCalendar()
      • getCalendarBefore

        public static Calendar getCalendarBefore​(Calendar date)