Package nl._42.beanie.generator.random
Class RandomStringGenerator
java.lang.Object
nl._42.beanie.generator.random.RandomStringGenerator
- All Implemented Interfaces:
ValueGenerator
Generates a random string within the specified length range
and using only the specified letters.
- Since:
- Feb 14, 2014
- Author:
- Sander Benschop
-
Constructor Summary
ConstructorsConstructorDescriptionRandomStringGenerator
(int maximum) RandomStringGenerator
(int minimum, int maximum) RandomStringGenerator
(int minimum, int maximum, String letters) -
Method Summary
Modifier and TypeMethodDescriptionGenerate a new value of the specified type.randomBigDecimal
(double maximum) boolean
randomBoolean
(double d) double
double
randomDouble
(double maximum) int
randomInt
(int n) int
randomInt
(int minimum, int maximum) long
randomLong
(int maximum) long
randomLong
(int minimum, int maximum) randomString
(int length)
-
Constructor Details
-
RandomStringGenerator
public RandomStringGenerator(int maximum) -
RandomStringGenerator
public RandomStringGenerator(int minimum, int maximum) -
RandomStringGenerator
-
-
Method Details
-
generate
Description copied from interface:ValueGenerator
Generate a new value of the specified type.- Specified by:
generate
in interfaceValueGenerator
- Parameters:
type
- the type of value- Returns:
- the generation value
-
randomString
-
randomInt
public int randomInt(int n) -
randomBoolean
public boolean randomBoolean(double d) -
randomInt
public int randomInt(int minimum, int maximum) -
randomLong
public long randomLong(int maximum) -
randomLong
public long randomLong(int minimum, int maximum) -
randomDouble
public double randomDouble() -
randomDouble
public double randomDouble(double maximum) -
randomBigDecimal
-
randomBigDecimal
-