OpenAPI 1.0

com.aquafold.openapi.random
Interface AQRandomDataSet


public interface AQRandomDataSet

This interface generates a new AQDataSet using the constraints described below:

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:


Method Summary
 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.
 

Method Detail

nextDataSet

AQDataSet nextDataSet()
                      throws Exception
Randomly generates a new data set.

Throws:
Exception

setColumnNameLengthConstraints

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.

Parameters:
minLength - the minimum length
maxLength - the maximum length

setDataStringLengthConstraints

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.

Parameters:
minLength - the minimum length
maxLength - the maximum length

setRows

void setRows(int rows)
Sets the number of rows to generate.

Parameters:
rows - the number of rows, needs to be greater than or equal to zero

setColumns

void setColumns(int columns)
Sets the number of columns to generate. Note that the number of columns set here could be affected by setTypes(String[] types).

Parameters:
columns - the number of columns

setType

void setType(String type)
Sets the type for all of generated columns.

Parameters:
type - the column type

setTypes

void setTypes(String[] types)
Sets the types for the columns to be generated. This method will implicitly override the number of columns set by setColumns(int columns) using the length of the specified type array.

Parameters:
types - the column types

setRange

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.

Parameters:
range - the range constraint, the system default range is used if null

setRanges

void setRanges(AQRandomRange[] ranges)
Sets the ranges to be applied to the generated data, one for each column.

Parameters:
ranges - the range constraints, ignored if null or the system default replaces the null array member

setVariation

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.

Parameters:
variation - the variation constraint, ignored if null

setVariations

void setVariations(AQRandomVariation[] variations)
Sets the variations to be applied to the generated data, one for each column.

Parameters:
variations - the variation constraints, ignored if null or null array member is ignored

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.