* Applies a randomly chosen value. * Uses Field.randomizeValue internally. * Does nothing when randomizable is set to false. * @param {Random} [random] Random number generator * @return {Field} Fluent interface
(random = null)
| 305 | * @return {Field} Fluent interface |
| 306 | */ |
| 307 | randomize (random = null) { |
| 308 | if (!this.isRandomizable()) { |
| 309 | return this |
| 310 | } |
| 311 | const value = this.randomizeValue(random || new Random()) |
| 312 | if (value !== null) { |
| 313 | return this.setValue(value) |
| 314 | } |
| 315 | return this |
| 316 | } |
| 317 | |
| 318 | /** |
| 319 | * Returns a randomly chosen value or `null` if not applicable. |
nothing calls this directly
no test coverage detected