|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpl.kernelpanic.dbmonster.generator.BasicDataGenerator
pl.kernelpanic.dbmonster.generator.StringGenerator
public class StringGenerator
String generator. Recognizes the following properties:
| minLength | minimal length of generated string (default: 0) |
| maxLength | maximum length of generated string (default: 255) |
| allowSpaces | should this column contain spaces? (default: true) |
| excludeChars | characters that should not appear in generated string (no default value) |
| nulls | How many nulls on average should this generator produce
per every 100 rows (default: 0) |
| Field Summary |
|---|
| Fields inherited from class pl.kernelpanic.dbmonster.generator.BasicDataGenerator |
|---|
column, nulls |
| Constructor Summary | |
|---|---|
StringGenerator()
|
|
| Method Summary | |
|---|---|
Object |
generate()
Generates random string. |
boolean |
getAllowSpaces()
Return allowSpaces parameter. |
String |
getExcludeChars()
Returns an exclude chars. |
int |
getMaxLength()
Returns the maximal length of the string. |
int |
getMinLength()
Returns the minimal length of the string. |
void |
initialize(DBMonsterContext ctx)
Initializes the generator. |
void |
reset()
Resets the generator. |
void |
setAllowSpaces(boolean spaces)
Sets the allowSpaces parameter. |
void |
setExcludeChars(String chars)
Sets the excluded characters. |
void |
setMaxLength(int length)
Sets the maximal length of the string. |
void |
setMinLength(int length)
Sets the minimal length of the string. |
| Methods inherited from class pl.kernelpanic.dbmonster.generator.BasicDataGenerator |
|---|
getColumn, getNulls, setColumn, setNulls |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringGenerator()
| Method Detail |
|---|
public void initialize(DBMonsterContext ctx)
throws Exception
initialize in interface Initializablectx - context
Exception - of errorspublic Object generate()
generate in interface DataGeneratornull.public final int getMinLength()
public void setMinLength(int length)
length - minimal lengthpublic int getMaxLength()
public void setMaxLength(int length)
length - maximal lengthpublic boolean getAllowSpaces()
true if generated string
can contain spaces.public void setAllowSpaces(boolean spaces)
spaces - true or falsepublic String getExcludeChars()
public void setExcludeChars(String chars)
chars - the characters to excludepublic void reset()
reset in interface DataGenerator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||