org.test4j.datafilling.strategy
类 RandomDataFactory

java.lang.Object
  继承者 org.test4j.datafilling.strategy.RandomDataFactory
所有已实现的接口:
DataFactory

public class RandomDataFactory
extends Object
implements DataFactory

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
 

字段详细信息

NICE_ASCII_CHARACTERS

public static final char[] NICE_ASCII_CHARACTERS
An array of valid String characters

方法详细信息

getInstance

public static RandomDataFactory getInstance()
Implementation of the Singleton pattern

返回:
A singleton instance of this class

getByte

public Byte getByte(AttributeInfo attribute)
It returns a byte/Byte value.

指定者:
接口 DataFactory 中的 getByte

getByteInRange

public Byte getByteInRange(byte minValue,
                           byte maxValue,
                           AttributeInfo attribute)
It returns a byte/Byte within min and max value (included).

指定者:
接口 DataFactory 中的 getByteInRange
参数:
minValue - The minimum value for the returned value
maxValue - The maximum value for the returned value
返回:
A byte/Byte within min and max value (included).

getCharacter

public Character getCharacter(AttributeInfo attribute)
It returns a char/Character value.

指定者:
接口 DataFactory 中的 getCharacter

getCharacterInRange

public Character getCharacterInRange(char minValue,
                                     char maxValue,
                                     AttributeInfo attribute)
It returns a char/Character value between min and max value (included).

指定者:
接口 DataFactory 中的 getCharacterInRange
参数:
minValue - The minimum value for the returned value
maxValue - The maximum value for the returned value
返回:
A char/Character value between min and max value (included).

getDouble

public Double getDouble(AttributeInfo attribute)
It returns a double/Double value

指定者:
接口 DataFactory 中的 getDouble

getDoubleInRange

public Double getDoubleInRange(double minValue,
                               double maxValue,
                               AttributeInfo attribute)
It returns a double/Double value between min and max value (included).

指定者:
接口 DataFactory 中的 getDoubleInRange
参数:
minValue - The minimum value for the returned value
maxValue - The maximum value for the returned value
返回:
A double/Double value between min and max value (included)

getFloat

public Float getFloat(AttributeInfo attribute)
It returns a float/Float value.

指定者:
接口 DataFactory 中的 getFloat

getFloatInRange

public Float getFloatInRange(float minValue,
                             float maxValue,
                             AttributeInfo attribute)
It returns a float/Float value between min and max value (included).

指定者:
接口 DataFactory 中的 getFloatInRange
参数:
minValue - The minimum value for the returned value
maxValue - The maximum value for the returned value
返回:
A float/Float value between min and max value (included).

getInteger

public Integer getInteger(AttributeInfo attribute)
It returns an int/Integer value.

指定者:
接口 DataFactory 中的 getInteger

getIntegerInRange

public int getIntegerInRange(int minValue,
                             int maxValue,
                             AttributeInfo attribute)
It returns an int/Integer value between min and max value (included).

指定者:
接口 DataFactory 中的 getIntegerInRange
参数:
minValue - The minimum value for the returned value
maxValue - The maximum value for the returned value
返回:
An int/Integer value between min and max value (included).

getLong

public Long getLong(AttributeInfo attribute)
This implementation returns the current time in milliseconds.

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

getLongInRange

public Long getLongInRange(long minValue,
                           long maxValue,
                           AttributeInfo attribute)
It returns a long/Long value between min and max value (included).

指定者:
接口 DataFactory 中的 getLongInRange
参数:
minValue - The minimum value for the returned value
maxValue - The maximum value for the returned value
返回:
A long/Long value between min and max value (included).

getShort

public Short getShort(AttributeInfo attribute)
It returns a short/Short value.

指定者:
接口 DataFactory 中的 getShort

getShortInRange

public Short getShortInRange(short minValue,
                             short maxValue,
                             AttributeInfo attribute)
It returns a short/Short value between min and max value (included).

指定者:
接口 DataFactory 中的 getShortInRange
参数:
minValue - The minimum value for the returned value
maxValue - The maximum value for the returned value
返回:
A short/Short value between min and max value (included).

getStringValue

public String getStringValue(AttributeInfo attribute)
It returns a string value

指定者:
接口 DataFactory 中的 getStringValue

getStringOfLength

public String getStringOfLength(int length,
                                AttributeInfo attribute)
It returns a String of length characters.

指定者:
接口 DataFactory 中的 getStringOfLength
参数:
length - The number of characters required in the returned String
返回:
A String of length characters


Copyright © 2013. All rights reserved.