Class RandomString


  • public class RandomString
    extends java.lang.Object
    A provider of randomized String values.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_LENGTH
      The default length of a randomized String.
    • Constructor Summary

      Constructors 
      Constructor Description
      RandomString()
      Creates a random String provider where each String is of DEFAULT_LENGTH length.
      RandomString​(int length)
      Creates a random String provider where each value is of the given length.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String hashOf​(int value)
      Represents an integer value as a string hash.
      static java.lang.String make()
      Creates a random String of DEFAULT_LENGTH length.
      static java.lang.String make​(int length)
      Creates a random String of the given length.
      java.lang.String nextString()
      Creates a new random String.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_LENGTH

        public static final int DEFAULT_LENGTH
        The default length of a randomized String.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RandomString

        public RandomString()
        Creates a random String provider where each String is of DEFAULT_LENGTH length.
      • RandomString

        public RandomString​(int length)
        Creates a random String provider where each value is of the given length.
        Parameters:
        length - The length of the random String.
    • Method Detail

      • make

        public static java.lang.String make()
        Creates a random String of DEFAULT_LENGTH length.
        Returns:
        A random String.
      • make

        public static java.lang.String make​(int length)
        Creates a random String of the given length.
        Parameters:
        length - The length of the random String.
        Returns:
        A random String.
      • hashOf

        public static java.lang.String hashOf​(int value)
        Represents an integer value as a string hash. This string is not technically random but generates a fixed character sequence based on the hash provided.
        Parameters:
        value - The value to represent as a string.
        Returns:
        A string representing the supplied value as a string.
      • nextString

        public java.lang.String nextString()
        Creates a new random String.
        Returns:
        A random String of the given length for this instance.