Class AbstRandomBasedFactory.Builder<T,​B extends AbstRandomBasedFactory.Builder<T,​B>>

    • Constructor Detail

      • Builder

        protected Builder()
    • Method Detail

      • withSafeRandom

        public B withSafeRandom()
        Set the random generator with a safe algorithm. Use it to replace the DefaultRandomFunction with SecureRandom.
        Returns:
        the generator
      • withRandom

        public B withRandom​(Random random)
        Set the random generator.
        Parameters:
        random - a random
        Returns:
        the builder
      • withRandomFunction

        public B withRandomFunction​(LongSupplier randomFunction)
        Set a random function which returns random numbers.
        Parameters:
        randomFunction - a function
        Returns:
        the builder
      • build

        public abstract T build()
        Finishes the factory building.
        Returns:
        the build factory