|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.test4j.datafilling.strategy.RandomDataFactory
public class RandomDataFactory
Default implementation of a DataFactory
This default implementation returns values based on a random generator. Don't use this implementation if you seek deterministic values
All values returned by this implementation are different from zero.
This implementation is a Singleton
| 字段摘要 | |
|---|---|
static char[] |
NICE_ASCII_CHARACTERS
An array of valid String characters |
| 方法摘要 | |
|---|---|
Byte |
getByte(AttributeInfo attribute)
It returns a byte/Byte value. |
Byte |
getByteInRange(byte minValue,
byte maxValue,
AttributeInfo attribute)
It returns a byte/Byte within min and max value (included). |
Character |
getCharacter(AttributeInfo attribute)
It returns a char/Character value. |
Character |
getCharacterInRange(char minValue,
char maxValue,
AttributeInfo attribute)
It returns a char/Character value between min and max value (included). |
Double |
getDouble(AttributeInfo attribute)
It returns a double/Double value |
Double |
getDoubleInRange(double minValue,
double maxValue,
AttributeInfo attribute)
It returns a double/Double value between min and max value (included). |
Float |
getFloat(AttributeInfo attribute)
It returns a float/Float value. |
Float |
getFloatInRange(float minValue,
float maxValue,
AttributeInfo attribute)
It returns a float/Float value between min and max value (included). |
static RandomDataFactory |
getInstance()
Implementation of the Singleton pattern |
Integer |
getInteger(AttributeInfo attribute)
It returns an int/Integer value. |
int |
getIntegerInRange(int minValue,
int maxValue,
AttributeInfo attribute)
It returns an int/Integer value between min and max value (included). |
Long |
getLong(AttributeInfo attribute)
This implementation returns the current time in milliseconds. |
Long |
getLongInRange(long minValue,
long maxValue,
AttributeInfo attribute)
It returns a long/Long value between min and max value (included). |
Short |
getShort(AttributeInfo attribute)
It returns a short/Short value. |
Short |
getShortInRange(short minValue,
short maxValue,
AttributeInfo attribute)
It returns a short/Short value between min and max value (included). |
String |
getStringOfLength(int length,
AttributeInfo attribute)
It returns a String of length characters. |
String |
getStringValue(AttributeInfo attribute)
It returns a string value |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
public static final char[] NICE_ASCII_CHARACTERS
| 方法详细信息 |
|---|
public static RandomDataFactory getInstance()
public Byte getByte(AttributeInfo attribute)
DataFactory 中的 getByte
public Byte getByteInRange(byte minValue,
byte maxValue,
AttributeInfo attribute)
DataFactory 中的 getByteInRangeminValue - The minimum value for the returned valuemaxValue - The maximum value for the returned value
public Character getCharacter(AttributeInfo attribute)
DataFactory 中的 getCharacter
public Character getCharacterInRange(char minValue,
char maxValue,
AttributeInfo attribute)
DataFactory 中的 getCharacterInRangeminValue - The minimum value for the returned valuemaxValue - The maximum value for the returned value
public Double getDouble(AttributeInfo attribute)
DataFactory 中的 getDouble
public Double getDoubleInRange(double minValue,
double maxValue,
AttributeInfo attribute)
DataFactory 中的 getDoubleInRangeminValue - The minimum value for the returned valuemaxValue - The maximum value for the returned value
public Float getFloat(AttributeInfo attribute)
DataFactory 中的 getFloat
public Float getFloatInRange(float minValue,
float maxValue,
AttributeInfo attribute)
DataFactory 中的 getFloatInRangeminValue - The minimum value for the returned valuemaxValue - The maximum value for the returned value
public Integer getInteger(AttributeInfo attribute)
DataFactory 中的 getInteger
public int getIntegerInRange(int minValue,
int maxValue,
AttributeInfo attribute)
DataFactory 中的 getIntegerInRangeminValue - The minimum value for the returned valuemaxValue - The maximum value for the returned value
public Long getLong(AttributeInfo attribute)
This can be useful for Date-like constructors which accept a long as argument. A complete random number would cause the instantiation of such classes to fail on a non-deterministic basis, e.g. when the random long would not be an acceptable value for, say, a YEAR field.
It returns a long/Long value.
DataFactory 中的 getLong
public Long getLongInRange(long minValue,
long maxValue,
AttributeInfo attribute)
DataFactory 中的 getLongInRangeminValue - The minimum value for the returned valuemaxValue - The maximum value for the returned value
public Short getShort(AttributeInfo attribute)
DataFactory 中的 getShort
public Short getShortInRange(short minValue,
short maxValue,
AttributeInfo attribute)
DataFactory 中的 getShortInRangeminValue - The minimum value for the returned valuemaxValue - The maximum value for the returned value
public String getStringValue(AttributeInfo attribute)
DataFactory 中的 getStringValue
public String getStringOfLength(int length,
AttributeInfo attribute)
length characters.
DataFactory 中的 getStringOfLengthlength - The number of characters required in the returned String
length characters
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||