public final class RandomExtensions extends Object
| Constructor and Description |
|---|
RandomExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static BigDecimal |
getRandomBigDecimal(int afterComma,
int beforeComma)
Deprecated.
use instead the same name method in the
RandomNumberExtensions
class. Note: will be remove in the next minor release |
static Byte |
getRandomByte()
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static Byte[] |
getRandomByteArray(int length)
The Method getRandomByteArray(int) generates a random Byte array.
|
static <T> T |
getRandomEntry(List<T> list)
Returns a random entry from the given List.
|
static <K,V> Object |
getRandomEntry(Map<K,V> map)
Returns a random entry from the given map.
|
static <T extends Enum<?>> |
getRandomEnumFromClass(Class<T> clazz)
Gets the random enum.
|
static <T extends Enum<?>> |
getRandomEnumFromClassname(String classname)
Gets the random enum.
|
static <T extends Enum<?>> |
getRandomEnumFromEnumValues(T[] values)
Gets the random enum.
|
static <T extends Enum<?>> |
getRandomEnumFromObject(T obj)
Gets the random enum.
|
static Float |
getRandomFloat(int afterComma,
int beforeComma)
The Method getRandomFloat(int,int) gets an random float.
|
static String |
getRandomHexString(int numberOfCharacters)
Generates a random hexadecimal
String |
static <T> int |
getRandomIndex(Collection<T> list)
Returns a random index from the given List.
|
static int |
getRandomIntBetween(int minVolume,
int maxVolume)
Returns a random int between the range from minVolume and maxVolume with the
Math.abs method. |
static <K,V> Object |
getRandomKey(Map<K,V> map)
Returns a random key from the given map.
|
static String |
getRandomNumericString()
Deprecated.
use instead the same name method in the
RandomNumberExtensions
class. Note: will be remove in the next minor release |
static String |
getRandomNumericString(int length)
Deprecated.
use instead the same name method in the
RandomNumberExtensions
class. Note: will be remove in the next minor release |
static byte[] |
getRandomPrimitiveByteArray(int length)
The Method getRandomPrimitiveByteArray(int) generates a random byte array.
|
static byte[] |
getRandomSalt(int length,
Charset charset)
Gets the random salt.
|
static String |
getRandomString()
Generates a random string with a length between 3 and 25
|
static String |
getRandomString(int length)
Generates a random string.
|
static String |
getRandomString(int start,
int end)
Generates a random string with a length between the given start and end
|
static String |
getRandomString(String[] array)
The Method randomString(String []) a random String from the Array For example: The
Stringarray test as argument.
|
static String |
getRandomString(String chars,
int length)
The Method randomString(String, int) makes an random String from the given String and to the
spezified length.
|
static SecureRandom |
getSecureRandom()
Gets the secure random.
|
static int |
newRandomPixel()
Generates a random int for use with pixel.
|
static int |
newRandomPixel(int red,
int green,
int blue,
int alpha)
Generates a random int for use with pixel.
|
static byte[] |
newSalt()
Factory method for create a new random salt.
|
static BigDecimal |
randomBigDecimal()
Deprecated.
use instead the same name method in the
RandomNumberExtensions
class. Note: will be remove in the next minor release |
static BigInteger |
randomBigInteger()
Deprecated.
use instead the same name method in the
RandomNumberExtensions
class. Note: will be remove in the next minor release |
static boolean |
randomBoolean()
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static byte |
randomByte()
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static byte[] |
randomByteArray(int length)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static char |
randomChar()
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static char |
randomChar(String string)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static double |
randomDouble()
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static double |
randomDouble(double range)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static double |
randomDoubleBetween(double start,
double end)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static double |
randomDoubleBetween(double start,
double end,
String pattern)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static float |
randomFloat()
Deprecated.
use instead the same name method in the
RandomNumberExtensions
class. Note: will be remove in the next minor release |
static float |
randomFloat(float range)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static float |
randomFloat(int afterComma,
int beforeComma)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static float |
randomFloatBetween(float start,
float end)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static float |
randomFloatBetween(float start,
float end,
String pattern)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static int |
randomInt()
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static int |
randomInt(int range)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static int |
randomIntBetween(int start,
int end)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static int |
randomIntBetween(int start,
int end,
boolean includeMin,
boolean includeMax)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static long |
randomLong()
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static long |
randomLong(long range)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static long |
randomLongBetween(long start,
long end)
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static BigInteger |
randomSerialNumber()
Returns a random serial number that can be used for a serial number.
|
static short |
randomShort()
Deprecated.
use instead the same name method in the
RandomPrimitivesExtensions
class. Note: will be remove in the next minor release |
static String |
randomToken()
Returns a random token for use in web services.
|
static UUID |
randomUUID()
Factory method for create a new random
UUID |
@Deprecated public static long randomLong()
RandomPrimitivesExtensions
class. @Deprecated public static long randomLong(long range)
RandomPrimitivesExtensions
class. range - the range@Deprecated public static long randomLongBetween(long start, long end)
RandomPrimitivesExtensions
class. start - The long from where the range starts.end - The long from where the range ends.@Deprecated public static float randomFloat()
RandomNumberExtensions
class. public static SecureRandom getSecureRandom()
public static int newRandomPixel()
public static int newRandomPixel(int red,
int green,
int blue,
int alpha)
red - The red value.green - The green value.blue - The blue value.alpha - The alpha value.@Deprecated public static BigDecimal getRandomBigDecimal(int afterComma, int beforeComma)
RandomNumberExtensions
class. afterComma - How many decimal places after the comma.beforeComma - How many decimal places before the comma.@Deprecated public static Byte getRandomByte()
RandomPrimitivesExtensions
class. public static Byte[] getRandomByteArray(int length)
length - the length.public static <T> T getRandomEntry(List<T> list)
T - the generic typelist - The List.public static <K,V> Object getRandomEntry(Map<K,V> map)
K - the key typeV - the value typemap - The map.public static <T extends Enum<?>> T getRandomEnumFromClass(Class<T> clazz)
T - the generic typeclazz - the clazzpublic static <T extends Enum<?>> T getRandomEnumFromClassname(String classname)
T - the generic typeclassname - the classnamepublic static <T extends Enum<?>> T getRandomEnumFromObject(T obj)
T - the generic typeobj - the objpublic static <T extends Enum<?>> T getRandomEnumFromEnumValues(T[] values)
T - the generic typevalues - the valuespublic static Float getRandomFloat(int afterComma, int beforeComma)
afterComma - How many decimal places after the comma.beforeComma - How many decimal places before the comma.public static <T> int getRandomIndex(Collection<T> list)
T - the generic typelist - The List.public static <K,V> Object getRandomKey(Map<K,V> map)
K - the key typeV - the value typemap - The map.@Deprecated public static String getRandomNumericString()
RandomNumberExtensions
class. @Deprecated public static String getRandomNumericString(int length)
RandomNumberExtensions
class. length - The length from the random number.public static String getRandomString(int length)
length - the specified length.public static String getRandomHexString(int numberOfCharacters)
StringnumberOfCharacters - the number of charactersStringpublic static String getRandomString(String chars, int length)
chars - The String to get the random chars.length - The length from the random String.public static String getRandomString()
public static String getRandomString(int start, int end)
start - the startend - the endpublic static String getRandomString(String[] array)
array - The array with the String to be selected.@Deprecated public static boolean randomBoolean()
RandomPrimitivesExtensions
class. @Deprecated public static byte randomByte()
RandomPrimitivesExtensions
class. @Deprecated public static byte[] randomByteArray(int length)
RandomPrimitivesExtensions
class. length - the length.@Deprecated public static char randomChar()
RandomPrimitivesExtensions
class. @Deprecated public static short randomShort()
RandomPrimitivesExtensions
class. @Deprecated public static char randomChar(String string)
RandomPrimitivesExtensions
class. string - The String from who to select the char.@Deprecated public static double randomDouble(double range)
RandomPrimitivesExtensions
class. range - the range@Deprecated public static double randomDouble()
RandomPrimitivesExtensions
class. @Deprecated public static double randomDoubleBetween(double start, double end)
RandomPrimitivesExtensions
class. start - the startend - the end@Deprecated public static double randomDoubleBetween(double start, double end, String pattern) throws ParseException
RandomPrimitivesExtensions
class. DecimalFormat.start - the startend - the endpattern - the patternParseException - is thrown if the beginning of the specified string cannot be parsed@Deprecated public static float randomFloat(float range)
RandomPrimitivesExtensions
class. range - the range@Deprecated public static float randomFloat(int afterComma, int beforeComma)
RandomPrimitivesExtensions
class. afterComma - How many decimal places after the comma.beforeComma - How many decimal places before the comma.@Deprecated public static float randomFloatBetween(float start, float end)
RandomPrimitivesExtensions
class. start - the startend - the end@Deprecated public static float randomFloatBetween(float start, float end, String pattern) throws ParseException
RandomPrimitivesExtensions
class. DecimalFormat.start - the startend - the endpattern - the patternParseException - is thrown if the beginning of the specified string cannot be parsed@Deprecated public static int randomInt()
RandomPrimitivesExtensions
class. public static UUID randomUUID()
UUIDUUID@Deprecated public static int randomInt(int range)
RandomPrimitivesExtensions
class. range - The Range.@Deprecated public static int randomIntBetween(int start, int end)
RandomPrimitivesExtensions
class. start - The int from where the range starts.end - The int from where the range ends.@Deprecated public static int randomIntBetween(int start, int end, boolean includeMin, boolean includeMax)
RandomPrimitivesExtensions
class. start - The int from where the range starts.end - The int from where the range ends.includeMin - if true than min value is includedincludeMax - if true than max value is includedpublic static int getRandomIntBetween(int minVolume,
int maxVolume)
Math.abs method.minVolume - the min volumemaxVolume - the max volumepublic static String randomToken()
public static BigInteger randomSerialNumber()
BigInteger object.public static byte[] getRandomPrimitiveByteArray(int length)
length - the length.public static byte[] newSalt()
public static byte[] getRandomSalt(int length,
Charset charset)
length - the lengthcharset - the charset@Deprecated public static BigInteger randomBigInteger()
RandomNumberExtensions
class. BigIntegerBigInteger@Deprecated public static BigDecimal randomBigDecimal()
RandomNumberExtensions
class. BigDecimalBigDecimalCopyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.