* Returns a randomly chosen value or null if not applicable. * @param {Random} random Random number generator * @return {mixed} Randomly chosen value
(random)
| 289 | * @return {mixed} Randomly chosen value |
| 290 | */ |
| 291 | randomizeValue (random) { |
| 292 | const value = super.randomizeValue(random) |
| 293 | if (value !== null) { |
| 294 | return value |
| 295 | } |
| 296 | if (this._min !== null && this._max !== null) { |
| 297 | return this._integer |
| 298 | ? random.nextInteger(this._min, Math.ceil(this._max) - 1) |
| 299 | : random.nextFloat(this._min, this._max) |
| 300 | } |
| 301 | return null |
| 302 | } |
| 303 | |
| 304 | /** |
| 305 | * Serializes the field value to a JSON serializable value. |
nothing calls this directly
no test coverage detected