java.lang.Object
org.refcodes.textual.RandomTextGenerartor
- All Implemented Interfaces:
Iterator<String>
,org.refcodes.generator.Generator<String>
,org.refcodes.mixin.CharSetAccessor
,org.refcodes.mixin.CharSetAccessor.CharSetBuilder<RandomTextGenerartor>
,org.refcodes.mixin.CharSetAccessor.CharSetMutator
,org.refcodes.mixin.CharSetAccessor.CharSetProperty
,org.refcodes.mixin.ColumnWidthAccessor
,org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<RandomTextGenerartor>
,org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
,org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
public class RandomTextGenerartor
extends Object
implements org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<RandomTextGenerartor>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty, org.refcodes.generator.Generator<String>, org.refcodes.mixin.CharSetAccessor.CharSetProperty, org.refcodes.mixin.CharSetAccessor.CharSetBuilder<RandomTextGenerartor>
Generates random text according to the
RandomTextMode
property and
other settings.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.CharSetAccessor
org.refcodes.mixin.CharSetAccessor.CharSetBuilder<B extends org.refcodes.mixin.CharSetAccessor.CharSetBuilder<B>>, org.refcodes.mixin.CharSetAccessor.CharSetMutator, org.refcodes.mixin.CharSetAccessor.CharSetProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.ColumnWidthAccessor
org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B extends org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B>>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
asRandom
(int aColumnWidth, char... aCharSet) Creates a random text from the given parameters.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.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.static String
asString
(int aColumnWidth) Creates a random text with the given length consisting of the characters found inRandomTextMode.ALPHANUMERIC
.static String
asString
(int aColumnWidth, RandomTextMode aRandomTextMode) Creates a random text from the given parameters.char[]
int
Retrieves the random text mode from the random text mode property.boolean
hasNext()
next()
void
setCharSet
(char[] aCharSet) void
setColumnWidth
(int aColumnWidth) void
setRandomTextMode
(RandomTextMode aRandomTextMode) Sets the random text mode for the random text mode property.withCharSet
(char[] aCharSet) withColumnWidth
(int aColumnWidth) withRandomTextMode
(RandomTextMode aRandomTextMode) Sets the random text mode for the random text mode property.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.mixin.CharSetAccessor.CharSetProperty
letCharSet
Methods inherited from interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
letColumnWidth
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
RandomTextGenerartor
public RandomTextGenerartor()
-
-
Method Details
-
withColumnWidth
- Specified by:
withColumnWidth
in interfaceorg.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<RandomTextGenerartor>
-
setColumnWidth
public void setColumnWidth(int aColumnWidth) - Specified by:
setColumnWidth
in interfaceorg.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
-
getColumnWidth
public int getColumnWidth()- Specified by:
getColumnWidth
in interfaceorg.refcodes.mixin.ColumnWidthAccessor
-
hasNext
public boolean hasNext() -
next
-
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
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 interfaceorg.refcodes.mixin.CharSetAccessor
-
setCharSet
public void setCharSet(char[] aCharSet) - Specified by:
setCharSet
in interfaceorg.refcodes.mixin.CharSetAccessor.CharSetMutator
-
withCharSet
- Specified by:
withCharSet
in interfaceorg.refcodes.mixin.CharSetAccessor.CharSetBuilder<RandomTextGenerartor>
-
withRandomTextMode
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
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
Creates a random text with the given length consisting of the characters found inRandomTextMode.ALPHANUMERIC
.- Parameters:
aColumnWidth
- The length of the text to generate.- Returns:
- The accordingly created random text.
-
asRandom
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
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
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.
-