@Deprecated public final class DataGenerator extends Object
DataGenerator can generate several random data of different data types. It
delegates to other random generator classes| Constructor and Description |
|---|
DataGenerator()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static Date |
dateAfter(Date date)
Deprecated.
Creates a random Date that is after from the given Date.
|
static Date |
dateAfter(Date date,
int range)
Deprecated.
Creates a random Date that is after from the given Date.
|
static Date |
dateBefore(Date date)
Deprecated.
Creates a random date that is before from the given date.
|
static Date |
dateBefore(Date date,
int range)
Deprecated.
Creates a random date that is before from the given date.
|
static BigDecimal |
getRandomBigDecimal(int afterComma,
int beforeComma)
Deprecated.
The Method getRandomBigDecimal(int,int) gets an random BigDecimal.
|
static Byte |
getRandomByte()
Deprecated.
Gets the random byte.
|
static Byte[] |
getRandomByteArray(int length)
Deprecated.
Gets the random byte array.
|
static <T> T |
getRandomEntry(List<T> list)
Deprecated.
Gets the random entry.
|
static <K,V> Object |
getRandomEntry(Map<K,V> map)
Deprecated.
Gets the random entry.
|
static <T extends Enum<?>> |
getRandomEnum(Class<T> clazz)
Deprecated.
Gets the random enum.
|
static <T extends Enum<?>> |
getRandomEnum(String classname)
Deprecated.
Gets the random enum.
|
static <T extends Enum<?>> |
getRandomEnum(T obj)
Deprecated.
Gets the random enum.
|
static <T extends Enum<?>> |
getRandomEnum(T[] values)
Deprecated.
Gets the random enum.
|
static Float |
getRandomFloat(int afterComma,
int beforeComma)
Deprecated.
Gets the random float.
|
static <T> int |
getRandomIndex(Collection<T> list)
Deprecated.
Gets the random index.
|
static <K,V> Object |
getRandomKey(Map<K,V> map)
Deprecated.
Gets the random key.
|
static String |
getRandomNumericString()
Deprecated.
Gets the random numeric string.
|
static String |
getRandomNumericString(int length)
Deprecated.
Gets the random numeric string.
|
static String |
getRandomString(int length)
Deprecated.
Gets the random string.
|
static String |
getRandomString(String[] array)
Deprecated.
Gets the random string.
|
static String |
getRandomString(String chars,
int length)
Deprecated.
Gets the random string.
|
static Timestamp |
getTimestamp()
Deprecated.
Gets the timestamp.
|
static Timestamp |
getTimestamp(Date date)
Deprecated.
Gets the timestamp.
|
static Date |
randomBirthday()
Deprecated.
Random birthday.
|
static Date |
randomBirthday(Date from,
Date till)
Deprecated.
Random birthday.
|
static boolean |
randomBoolean()
Deprecated.
Random boolean.
|
static byte |
randomByte()
Deprecated.
Random byte.
|
static byte[] |
randomByteArray(int length)
Deprecated.
Random byte array.
|
static char |
randomChar()
Deprecated.
Random char.
|
static char |
randomChar(String string)
Deprecated.
Random char.
|
static Date |
randomDate(Date from)
Deprecated.
Random date.
|
static Date |
randomDatebetween(Date start,
Date end)
Deprecated.
Random datebetween.
|
static Date |
randomDateBetween(Date from,
int startDays,
int endDays)
Deprecated.
Random date between.
|
static String |
randomDatebetween(long startDate,
long endDate)
Deprecated.
Random datebetween.
|
static String |
randomDatebetween(long startDate,
long endDate,
String format)
Deprecated.
Random datebetween.
|
static double |
randomDouble(double range)
Deprecated.
Random double.
|
static double |
randomDoubleBetween(double start,
double end)
Deprecated.
Random double between.
|
static double |
randomDoubleBetween(double start,
double end,
String pattern)
Deprecated.
Random double between.
|
static float |
randomFloat(float range)
Deprecated.
Random float.
|
static float |
randomFloat(int afterComma,
int beforeComma)
Deprecated.
Random float.
|
static float |
randomFloatBetween(float start,
float end)
Deprecated.
Random float between.
|
static float |
randomFloatBetween(float start,
float end,
String pattern)
Deprecated.
Random float between.
|
static int |
randomInt()
Deprecated.
Random int.
|
static int |
randomInt(int range)
Deprecated.
Random int.
|
static int |
randomIntBetween(int start,
int end)
Deprecated.
Random int between.
|
public static Date dateAfter(Date date)
date - The Date from where to compute the future date.public static Date dateAfter(Date date, int range)
date - The Date from where to compute the future date.range - The range.public static Date dateBefore(Date date)
date - The date from where to compute the Past date.public static Date dateBefore(Date date, int range)
date - The date from where to compute the past date.range - The range.public static BigDecimal getRandomBigDecimal(int afterComma, int beforeComma)
afterComma - How many decimal places after the comma.beforeComma - How many decimal places before the comma.public static Byte getRandomByte()
public static Byte[] getRandomByteArray(int length)
length - the lengthpublic static <T> T getRandomEntry(List<T> list)
T - the generic typelist - the listpublic static <K,V> Object getRandomEntry(Map<K,V> map)
K - the key typeV - the value typemap - the mappublic static <T extends Enum<?>> T getRandomEnum(Class<T> clazz)
T - the generic typeclazz - the clazzpublic static <T extends Enum<?>> T getRandomEnum(String classname)
T - the generic typeclassname - the classnamepublic static <T extends Enum<?>> T getRandomEnum(T obj)
T - the generic typeobj - the objpublic static <T extends Enum<?>> T getRandomEnum(T[] values)
T - the generic typevalues - the valuespublic static Float getRandomFloat(int afterComma, int beforeComma)
afterComma - the after commabeforeComma - the before commapublic static <T> int getRandomIndex(Collection<T> list)
T - the generic typelist - the listpublic static <K,V> Object getRandomKey(Map<K,V> map)
K - the key typeV - the value typemap - the mappublic static String getRandomNumericString()
public static String getRandomNumericString(int length)
length - the lengthpublic static String getRandomString(int length)
length - the lengthpublic static String getRandomString(String chars, int length)
chars - the charslength - the lengthpublic static String getRandomString(String[] array)
array - the arraypublic static Timestamp getTimestamp()
public static Timestamp getTimestamp(Date date)
date - the datepublic static Date randomBirthday()
public static Date randomBirthday(Date from, Date till)
from - the fromtill - the tillpublic static boolean randomBoolean()
public static byte randomByte()
public static byte[] randomByteArray(int length)
length - the lengthpublic static char randomChar()
public static char randomChar(String string)
string - the stringpublic static Date randomDate(Date from)
from - the frompublic static Date randomDatebetween(Date start, Date end)
start - the startend - the endpublic static String randomDatebetween(long startDate, long endDate)
startDate - the start dateendDate - the end datepublic static String randomDatebetween(long startDate, long endDate, String format)
startDate - the start dateendDate - the end dateformat - the formatpublic static Date randomDateBetween(Date from, int startDays, int endDays)
from - the fromstartDays - the start daysendDays - the end dayspublic static double randomDouble(double range)
range - the rangepublic static double randomDoubleBetween(double start,
double end)
start - the startend - the endpublic static double randomDoubleBetween(double start,
double end,
String pattern)
throws ParseException
start - the startend - the endpattern - the patternParseException - is thrown if the beginning of the specified string cannot be parsedpublic static float randomFloat(float range)
range - the rangepublic static float randomFloat(int afterComma,
int beforeComma)
afterComma - the after commabeforeComma - the before commapublic static float randomFloatBetween(float start,
float end)
start - the startend - the endpublic static float randomFloatBetween(float start,
float end,
String pattern)
throws ParseException
start - the startend - the endpattern - the patternParseException - is thrown if the beginning of the specified string cannot be parsedpublic static int randomInt()
public static int randomInt(int range)
range - the rangepublic static int randomIntBetween(int start,
int end)
start - the startend - the endCopyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.