Class RandomTextGenerartor

java.lang.Object
org.refcodes.textual.RandomTextGenerartor
All Implemented Interfaces:
Iterator<String>, Generator<String>, CharSetAccessor, CharSetAccessor.CharSetBuilder<RandomTextGenerartor>, CharSetAccessor.CharSetMutator, CharSetAccessor.CharSetProperty, ColumnWidthAccessor, ColumnWidthAccessor.ColumnWidthBuilder<RandomTextGenerartor>, ColumnWidthAccessor.ColumnWidthMutator, ColumnWidthAccessor.ColumnWidthProperty

  • Constructor Details

    • RandomTextGenerartor

      public RandomTextGenerartor()
  • Method Details

    • withColumnWidth

      public RandomTextGenerartor withColumnWidth(int aColumnWidth)
      Specified by:
      withColumnWidth in interface ColumnWidthAccessor.ColumnWidthBuilder<RandomTextGenerartor>
    • setColumnWidth

      public void setColumnWidth(int aColumnWidth)
      Specified by:
      setColumnWidth in interface ColumnWidthAccessor.ColumnWidthMutator
    • getColumnWidth

      public int getColumnWidth()
      Specified by:
      getColumnWidth in interface ColumnWidthAccessor
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Generator<String>
      Specified by:
      hasNext in interface Iterator<String>
    • next

      public String next()
      Specified by:
      next in interface Generator<String>
      Specified by:
      next in interface Iterator<String>
    • getRandomTextMode

      public RandomTextMode getRandomTextMode()
      Retrieves the random text mode from the random text mode property.
      Returns:
      The random text mode stored by the random text mode property.
    • setRandomTextMode

      public void setRandomTextMode(RandomTextMode aRandomTextMode)
      Sets the random text mode for the random text mode property.
      Parameters:
      aRandomTextMode - The random text mode to be stored by the random text mode property.
    • getCharSet

      public char[] getCharSet()
      Specified by:
      getCharSet in interface CharSetAccessor
    • setCharSet

      public void setCharSet(char[] aCharSet)
      Specified by:
      setCharSet in interface CharSetAccessor.CharSetMutator
    • withCharSet

      public RandomTextGenerartor withCharSet(char[] aCharSet)
      Specified by:
      withCharSet in interface CharSetAccessor.CharSetBuilder<RandomTextGenerartor>
    • withRandomTextMode

      public RandomTextGenerartor withRandomTextMode(RandomTextMode aRandomTextMode)
      Sets the random text mode for the random text mode property.
      Parameters:
      aRandomTextMode - The random text mode to be stored by the random text mode property.
      Returns:
      The builder for applying multiple build operations.
    • asString

      public static String asString(int aColumnWidth, RandomTextMode aRandomTextMode)
      Creates a random text from the given parameters.
      Parameters:
      aColumnWidth - The length of the text to generate.
      aRandomTextMode - The chars to use for the random text.
      Returns:
      The accordingly created random text.
    • asString

      public static String asString(int aColumnWidth)
      Creates a random text with the given length consisting of the characters found in RandomTextMode.ALPHANUMERIC.
      Parameters:
      aColumnWidth - The length of the text to generate.
      Returns:
      The accordingly created random text.
    • asRandom

      public static String asRandom(int aColumnWidth, char... aCharSet)
      Creates a random text from the given parameters.
      Parameters:
      aColumnWidth - The length of the text to generate.
      aCharSet - The chars to use for the random text.
      Returns:
      The accordingly created random text.
    • asShuffled

      public static String asShuffled(char... aCharSet)
      Shuffles the provided characters to generate a text with the length of the number of provided characters containing each provided character though in a random order.
      Parameters:
      aCharSet - The chars to use for the shuffled text.
      Returns:
      The accordingly shuffled random text.
    • asShuffled

      public static String asShuffled(String aCharSet)
      Shuffles the provided characters to generate a text with the length of the number of provided characters containing each provided character though in a random order.
      Parameters:
      aCharSet - The chars to use for the shuffled text.
      Returns:
      The accordingly shuffled random text.