io.vertx.rxjava3.ext.auth

## Class VertxContextPRNG

- java.lang.Object
- - io.vertx.rxjava3.ext.auth.prng.VertxContextPRNG
  - - io.vertx.rxjava3.ext.auth.VertxContextPRNG

-     public class VertxContextPRNG
      extends VertxContextPRNG

  A secure non blocking random number generator isolated to the current context. The PRNG is bound to the vert.x context and setup to close when the context shuts down.

  When applicable, use of VertxContextPRNG rather than create new PRNG objects is helpful to keep the system entropy usage to the minimum avoiding potential blocking across the application.

  The use of VertxContextPRNG is particularly appropriate when multiple handlers use random numbers.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<VertxContextPRNG>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VertxContextPRNG(Object delegate)`
    `VertxContextPRNG(VertxContextPRNG delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static VertxContextPRNG` | `current()` Deprecated.
    `static VertxContextPRNG` | `current(Vertx vertx)` Deprecated.
    `boolean` | `equals(Object o)`
    `VertxContextPRNG` | `getDelegate()`
    `int` | `hashCode()`
    `static VertxContextPRNG` | `newInstance(VertxContextPRNG arg)`
    `String` | `toString()`

    - ### Methods inherited from class io.vertx.rxjava3.ext.auth.prng.VertxContextPRNG

      `close, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, nextString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<VertxContextPRNG> __TYPE_ARG

  - ### Constructor Detail

    - #### VertxContextPRNG

          public VertxContextPRNG(VertxContextPRNG delegate)

    - #### VertxContextPRNG

          public VertxContextPRNG(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `VertxContextPRNG`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `VertxContextPRNG`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `VertxContextPRNG`

    - #### getDelegate

          public VertxContextPRNG getDelegate()

      Overrides:
        `getDelegate` in class `VertxContextPRNG`

    - #### current

          @Deprecated
          public static VertxContextPRNG current()

      Deprecated.
      Get or create a secure non blocking random number generator using the current vert.x context. If there is no current context (i.e.: not running on the eventloop) then a `IllegalStateException` is thrown. Note, if a context isn't allowed to be used, for example, exceptions are thrown on getting and putting data, the VertxContextPRNG falls back to instantiate a new instance of the PRNG per call.
      Returns:
        A secure non blocking random number generator.

    - #### current

          @Deprecated
          public static VertxContextPRNG current(Vertx vertx)

      Deprecated.
      Get or create a secure non blocking random number generator using the current vert.x instance. Since the context might be different this method will attempt to use the current context first if available and then fall back to create a new instance of the PRNG. Note, if a context isn't allowed to be used, for example, exceptions are thrown on getting and putting data, the VertxContextPRNG falls back to instantiate a new instance of the PRNG per call.
      Parameters:
        `vertx` - a Vert.x instance.
      Returns:
        A secure non blocking random number generator.

    - #### newInstance

          public static VertxContextPRNG newInstance(VertxContextPRNG arg)

Copyright © 2024 Eclipse. All rights reserved.