public interface AQRandomDataSet
AQDataSet
using the constraints described below:
AQRandomDateRange
- can only be applied to a column with type set to date AQRandomNumberRange
- can only be applied to a column with type set to number AQRandomStringLength
- can only be applied to a column with type set to text AQRandomDateVariation
- can only be applied to a column with type set to date AQRandomNumberVariation
- can only be applied to a column with type set to number
In general, the number of defined column types implies the number of columns to generate.
However, a special case is supported where all of columns share the same type; in this case
application can invoke setColumns(int columns)
and setType(String type)
to set the desired constraints.
Instances of this interface can be instantiated by one of the following methods:
AQRandomFactory.newRandomDataSet()
AQRandomFactory.newRandomDataSet(int rows, String[] types, AQRandomRange[] ranges)
AQRandomFactory.newRandomDataSet(int rows, String[] types, AQRandomRange[] ranges, AQRandomVariation[] variations)
AQRandomFactory.newRandomDataSetByType(int rows, int columns, String type, AQRandomRange range)
AQRandomFactory.newRandomDataSetByType(int rows, int columns, String type, AQRandomRange range, AQRandomVariation variation)
Modifier and Type | Method and Description |
---|---|
AQDataSet |
nextDataSet()
Randomly generates a new data set.
|
void |
setColumnNameLengthConstraints(int minLength,
int maxLength)
Sets the constraint on the length of the generated column names,
both
minLength and maxLength need to be greater than zero in order to take effect. |
void |
setColumns(int columns)
Sets the number of columns to generate.
|
void |
setDataStringLengthConstraints(int minLength,
int maxLength)
Sets the default constraint on the length of the generated text string,
negative length indicates to generate a null object is allowed.
|
void |
setRange(AQRandomRange range)
Sets the range to be applied to the generated data,
this method expects there is only one column type is specified.
|
void |
setRanges(AQRandomRange[] ranges)
Sets the ranges to be applied to the generated data, one for each column.
|
void |
setRows(int rows)
Sets the number of rows to generate.
|
void |
setType(String type)
Sets the type for all of generated columns.
|
void |
setTypes(String[] types)
Sets the types for the columns to be generated.
|
void |
setVariation(AQRandomVariation variation)
Sets the variation to be applied to the generated data,
this method expects there is only one column type is specified.
|
void |
setVariations(AQRandomVariation[] variations)
Sets the variations to be applied to the generated data, one for each column.
|
AQDataSet nextDataSet() throws Exception
Exception
- on errorvoid setColumnNameLengthConstraints(int minLength, int maxLength)
minLength
and maxLength
need to be greater than zero in order to take effect.minLength
- the minimum lengthmaxLength
- the maximum lengthvoid setDataStringLengthConstraints(int minLength, int maxLength)
minLength
- the minimum lengthmaxLength
- the maximum lengthvoid setRows(int rows)
rows
- the number of rows, needs to be greater than or equal to zerovoid setColumns(int columns)
setTypes(String[] types)
.columns
- the number of columnsvoid setType(String type)
type
- the column typevoid setTypes(String[] types)
setColumns(int columns)
using the length of the specified type array.types
- the column typesvoid setRange(AQRandomRange range)
range
- the range constraint, the system default range is used if nullvoid setRanges(AQRandomRange[] ranges)
ranges
- the range constraints, ignored if null or the system default replaces the null array membervoid setVariation(AQRandomVariation variation)
variation
- the variation constraint, ignored if nullvoid setVariations(AQRandomVariation[] variations)
variations
- the variation constraints, ignored if null or null array member is ignored
Copyright © 2017 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.