Class RandomIdentifierGenerationStrategy

    • Field Detail

      • random

        private final Random random
        Random number generator.
      • sizeOfIdentifier

        private final int sizeOfIdentifier
        Number of random bytes in the identifier.
      • encoder

        private final org.apache.commons.codec.BinaryEncoder encoder
        Encoder used to convert the random bytes in to a string.
    • Constructor Detail

      • RandomIdentifierGenerationStrategy

        public RandomIdentifierGenerationStrategy()
        Constructor. Initializes the random number source to a new SecureRandom, size of identifier is set to 16 bytes, and the encoder is set to a Hex.
      • RandomIdentifierGenerationStrategy

        public RandomIdentifierGenerationStrategy​(int identifierSize)
        Constructor. Initializes the random number source to a new SecureRandom and the encoder is set to a Hex.
        Parameters:
        identifierSize - number of random bytes in identifier
      • RandomIdentifierGenerationStrategy

        public RandomIdentifierGenerationStrategy​(@Nonnull
                                                  Random source,
                                                  int identifierSize,
                                                  @Nonnull
                                                  org.apache.commons.codec.BinaryEncoder identifierEncoder)
        Constructor.
        Parameters:
        source - source of random bytes
        identifierSize - number of random bytes in the identifier
        identifierEncoder - encoder used to convert random bytes to string identifier