public final class RandomObjectsExtensions extends Object
RandomObjectsExtensions is a utility class to create random objects.| Constructor and Description |
|---|
RandomObjectsExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getInfomailFromWebsite(String url)
Gets an infomail address from the given url.
|
static String |
getRandomEmail()
The Method getRandomEmail() gets a random email-address.
|
static String |
getRandomFaxnumber(String phonenumber)
Gets a random faxnumber from a phone.
|
static String |
getRandomMobilnumber()
Gets a random mobil number from a mobilphone.
|
static String |
getRandomPassword(int length)
The Method getRandomPassword(int) produces a random password.
|
static String |
getRandomPassword(Optional<Integer> length)
The Method getRandomPassword(int) produces a random password.
|
static String |
getRandomPhonenumber()
Gets a random phonenumber.
|
static String |
getRandomWebsite()
Gets a random name for a website.
|
static String |
newRandomId()
Factory method for create a new random id and returns it
|
static String |
newRandomName(char[] donatedChars)
Factory method for create a new random name from the donated char array
|
static <T> T |
newRandomObject(@NonNull Class<T> cls)
Deprecated.
use instead the same name method in the factory class
|
static Object |
newRandomValue(Field field)
Deprecated.
use instead the same name method in the factory class
|
public static String getInfomailFromWebsite(String url)
url - The url.public static String getRandomEmail()
public static String getRandomFaxnumber(String phonenumber)
phonenumber - The phonenumber.public static String getRandomMobilnumber()
public static String getRandomPassword(int length)
length - The length from the password.public static String getRandomPassword(Optional<Integer> length)
length - The length from the password as Optional.public static String getRandomPhonenumber()
public static String getRandomWebsite()
public static String newRandomId()
public static String newRandomName(char[] donatedChars)
donatedChars - The Characters for the name@Deprecated public static <T> T newRandomObject(@NonNull @NonNull Class<T> cls) throws IllegalAccessException, InstantiationException, NoSuchFieldException
ClassT - the generic typecls - the classIllegalAccessException - is thrown if the class or its default constructor is not accessible.InstantiationException - is thrown if this Class represents an abstract class, an interface, an
array class, a primitive type, or void; or if the class has no default
constructor; or if the instantiation fails for some other reason.NoSuchFieldException - is thrown if no such field exists@Deprecated public static Object newRandomValue(Field field) throws IllegalAccessException, InstantiationException, NoSuchFieldException
fieldfield - the fieldIllegalAccessException - is thrown if the class or its default constructor is not accessible.InstantiationException - is thrown if this Class represents an abstract class, an interface, an
array class, a primitive type, or void; or if the class has no default
constructor; or if the instantiation fails for some other reason.NoSuchFieldException - is thrown if no such field existsCopyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.