T - factory typeB - builder typeprotected abstract static class AbstRandomBasedFactory.Builder<T,B extends AbstRandomBasedFactory.Builder<T,B>> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected AbstRandomBasedFactory.IRandom |
random
A random generator.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Builder() |
| Modifier and Type | Method and Description |
|---|---|
abstract T |
build()
Finishes the factory building.
|
protected AbstRandomBasedFactory.IRandom |
getRandom()
Get the random generator.
|
B |
withFastRandom()
Set the random generator with a fast algorithm.
|
B |
withRandom(Random random)
Set the random generator.
|
B |
withRandomFunction(LongSupplier randomFunction)
Set a random function which returns random numbers.
|
B |
withSafeRandom()
Set the random generator with a safe algorithm.
|
protected AbstRandomBasedFactory.IRandom random
protected AbstRandomBasedFactory.IRandom getRandom()
public B withFastRandom()
DefaultRandomFunction with
ThreadLocalRandom.public B withSafeRandom()
DefaultRandomFunction with
SecureRandom.public B withRandom(Random random)
random - a randompublic B withRandomFunction(LongSupplier randomFunction)
randomFunction - a functionpublic abstract T build()
Copyright © 2024. All rights reserved.