public abstract class ValueFactories extends Object
ValueFactory and ArrayFactory for use in the BeanBuilder and RandomBuilder| Constructor and Description |
|---|
ValueFactories() |
| Modifier and Type | Method and Description |
|---|---|
static <T> ValueFactory<T> |
aNewInstanceOf(Class<T> type)
Creates an
ValueFactory which returns a new unpopulated instance of the given type. |
static ValueFactory<Object> |
aNullValue()
Creates an
ValueFactory which returns a null value. |
static <A> ArrayFactory<A> |
aRandomArrayOf(ValueFactory<A> typeFactory)
Creates an
ArrayFactory which returns a random array of the given type. |
static ValueFactory<Boolean> |
aRandomBoolean()
Creates an
ValueFactory which returns a random Boolean. |
static ValueFactory<Byte> |
aRandomByte()
Creates an
ValueFactory which returns a random Byte. |
static ValueFactory<byte[]> |
aRandomByteArray()
Creates an
ValueFactory which returns a random array of bytes |
static ValueFactory<Character> |
aRandomChar()
Creates an
ValueFactory which returns a random Character. |
static ValueFactory<Date> |
aRandomDate()
Creates an
ValueFactory which returns a random Date. |
static ValueFactory<BigDecimal> |
aRandomDecimal()
Creates an
ValueFactory which returns a random BigDecimal. |
static ValueFactory<Double> |
aRandomDouble()
Creates an
ValueFactory which returns a random Double. |
static <E> ValueFactory<E> |
aRandomEnum(Class<E> enumType)
Creates an
ValueFactory which returns a random enum from the supplied Enum type. |
static ValueFactory<Float> |
aRandomFloat()
Creates an
ValueFactory which returns a random Float. |
static ValueFactory<Integer> |
aRandomInteger()
Creates an
ValueFactory which returns a random Integer. |
static ValueFactory<Long> |
aRandomLong()
Creates an
ValueFactory which returns a random Long. |
static ValueFactory<Short> |
aRandomShort()
Creates an
ValueFactory which returns a random Short. |
static ValueFactory<String> |
aRandomString()
Creates an
ValueFactory which returns a random String. |
static <T> ValueFactory<T> |
oneOf(Collection<ValueFactory<T>> factories)
Creates an
ValueFactory which returns a random instance of the given type by using one of the supplied ValueFactory instances. |
static <T> ValueFactory<T> |
oneOf(T... instances)
Creates an
ValueFactory which randomly returns one of the supplied instances. |
static <T> ValueFactory<T> |
oneOf(ValueFactory<T>... factories)
Creates an
ValueFactory which returns a random instance of the given type by using one of the supplied ValueFactory instances. |
static <T> ValueFactory<T> |
theValue(T value)
Creates an
ValueFactory which returns the supplied value. |
public static <T> ValueFactory<T> theValue(T value)
ValueFactory which returns the supplied value.value - the value to returnValueFactory which returns the supplied valuepublic static ValueFactory<Object> aNullValue()
ValueFactory which returns a null value.ValueFactory which returns a null value.public static ValueFactory<String> aRandomString()
ValueFactory which returns a random String.ValueFactory which returns a random String.public static ValueFactory<Integer> aRandomInteger()
ValueFactory which returns a random Integer.ValueFactory which returns a random Integer.public static ValueFactory<Short> aRandomShort()
ValueFactory which returns a random Short.ValueFactory which returns a random Short.public static ValueFactory<Long> aRandomLong()
ValueFactory which returns a random Long.ValueFactory which returns a random Long.public static ValueFactory<Double> aRandomDouble()
ValueFactory which returns a random Double.ValueFactory which returns a random Double.public static ValueFactory<Float> aRandomFloat()
ValueFactory which returns a random Float.ValueFactory which returns a random Float.public static ValueFactory<Boolean> aRandomBoolean()
ValueFactory which returns a random Boolean.ValueFactory which returns a random Boolean.public static ValueFactory<Date> aRandomDate()
ValueFactory which returns a random Date.ValueFactory which returns a random Date.public static ValueFactory<BigDecimal> aRandomDecimal()
ValueFactory which returns a random BigDecimal.ValueFactory which returns a random BigDecimal.public static ValueFactory<Byte> aRandomByte()
ValueFactory which returns a random Byte.ValueFactory which returns a random Byte.public static ValueFactory<byte[]> aRandomByteArray()
ValueFactory which returns a random array of bytesValueFactory which returns a random array of bytes.public static ValueFactory<Character> aRandomChar()
ValueFactory which returns a random Character.ValueFactory which returns a random Character.public static <E> ValueFactory<E> aRandomEnum(Class<E> enumType)
ValueFactory which returns a random enum from the supplied Enum type.enumType - the enumeration type to create a random value formValueFactory which returns a random enum from the supplied Enum typepublic static <A> ArrayFactory<A> aRandomArrayOf(ValueFactory<A> typeFactory)
ArrayFactory which returns a random array of the given type.typeFactory - the ValueFactory to use to create each instance in the random arrayArrayFactory which returns a random array of the given type.public static <T> ValueFactory<T> aNewInstanceOf(Class<T> type)
ValueFactory which returns a new unpopulated instance of the given type.type - the type to create a new instance ofArrayFactory which returns a new unpopulated instance of the given type.public static <T> ValueFactory<T> oneOf(ValueFactory<T>... factories)
ValueFactory which returns a random instance of the given type by using one of the supplied ValueFactory instances.factories - the factories to select from when creating the random valueValueFactory which returns a random instance of the given type by using one of the supplied ValueFactory instances.public static <T> ValueFactory<T> oneOf(Collection<ValueFactory<T>> factories)
ValueFactory which returns a random instance of the given type by using one of the supplied ValueFactory instances.factories - the factories to select from when creating the random valueValueFactory which returns a random instance of the given type by using one of the supplied ValueFactory instances.public static <T> ValueFactory<T> oneOf(T... instances)
ValueFactory which randomly returns one of the supplied instances.instances - the instances to select from when creating the random valueValueFactory which randomly returns one of the supplied instances.Copyright © 2015. All rights reserved.