T - the number type you can retrieve from this data providerpublic abstract class AbstractRandomNumberProvider<T extends Comparable<? extends Number>> extends AbstractRandomDataProvider<T> implements RandomNumberProvider<T>
Abstract data provider for numbers. Numbers are expected to be comparable.
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRandomNumberProvider(RandomNumberType<T> numberType)
Creates a random number provider bound to a specific type of numbers.
|
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Retrieve a random data.
|
RandomNumberType<T> |
getNumberType()
Return the number type used for random number generation.
|
RandomNumberProvider<T> |
max(T maxValue)
Specifies the maximum value to retrieve via random.
|
RandomNumberProvider<T> |
min(T minValue)
Specifies the minimum value to retrieve via random.
|
String |
toString() |
fixateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfixateprotected AbstractRandomNumberProvider(@Nonnull RandomNumberType<T> numberType)
Creates a random number provider bound to a specific type of numbers.
numberType - denotes the type of random numbers to providepublic RandomNumberProvider<T> min(@Nullable T minValue)
RandomNumberProviderSpecifies the minimum value to retrieve via random.
min in interface RandomNumberProvider<T extends Comparable<? extends Number>>minValue - the minimum value; null will cause to reset to minimum value of number typepublic RandomNumberProvider<T> max(@Nullable T maxValue)
RandomNumberProviderSpecifies the maximum value to retrieve via random.
max in interface RandomNumberProvider<T extends Comparable<? extends Number>>maxValue - the maximum value; null will cause to reset to maximum value of number typepublic T get() throws DataProvidingException
DataProviderget in interface DataProvider<T extends Comparable<? extends Number>>DataProvidingException - if an error occurred during data generation@Nonnull public final RandomNumberType<T> getNumberType()
Return the number type used for random number generation.
Copyright © 2011-2013 CoreMedia AG. All Rights Reserved.