Package herddb.utils
Class RandomString
- java.lang.Object
-
- herddb.utils.RandomString
-
public class RandomString extends Object
Simple facilit to generate random strings for tests- Author:
- diego.salvi
-
-
Constructor Summary
Constructors Constructor Description RandomString(char[] alphabet)Build a newRandomStringwith a specific alphabet.RandomString(Random random)Build a newRandomStringwith a specific random generator, useful when repeatable random sequences are needed.RandomString(Random random, char[] alphabet)Build a newRandomStringwith a specific random generator, useful when repeatable random sequences are needed.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RandomStringgetInstance()StringnextString(int len)StringnextString(int min, int max)StringBuildernextString(int min, int max, StringBuilder builder)StringBuildernextString(int len, StringBuilder builder)
-
-
-
Constructor Detail
-
RandomString
public RandomString(char[] alphabet)
Build a newRandomStringwith a specific alphabet.
-
RandomString
public RandomString(Random random)
Build a newRandomStringwith a specific random generator, useful when repeatable random sequences are needed.
-
RandomString
public RandomString(Random random, char[] alphabet)
Build a newRandomStringwith a specific random generator, useful when repeatable random sequences are needed.
-
-
Method Detail
-
getInstance
public static RandomString getInstance()
-
nextString
public String nextString(int len)
-
nextString
public String nextString(int min, int max)
-
nextString
public StringBuilder nextString(int len, StringBuilder builder)
-
nextString
public StringBuilder nextString(int min, int max, StringBuilder builder)
-
-