@Bool()
New in 2.0Generate boolean values
Data TypesSince 2.0.0
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| trueWeight | String | — | 2:1 | True ratio, e.g. "2:1" means 2 true per 3 values on average |
| nullSampler | String | — | — | The null ratio, such as "1:2", indicates that generating a random value 3 times with an average of 1 time is null |
| dict | String | — | true|false | Boolean dictionary values separated by "|", first=true, second=false. Default: true|false |
Usage
@Bool()Generate true/false with 2:1 ratio
Example:
@Bool()
Output:
truefalse@Bool(trueWeight,nullWeight)Generate true/false/null with specified true and null ratios
Example:
@Bool(2:1,1:5)
Output:
truenullfalse@Bool(trueWeight)Generate true/false/null with specified null ratio
Example:
@Bool(2:1)
Output:
truetruefalse@Bool(trueWeight,nullWeight,dict)Full parameter constructor, see complete parameter documentation
Example:
@Bool(2:1,1:5,1|0)
Output:
1null0