@Test public void testCreateRandomAlphanumeric() { final String randomAlphanumeric = Utilities.createRandomAlphanumeric(32); assertTrue("32 alphanumeric character sequence", Pattern.compile("[0-9a-zA-Z]{32}").matcher(randomAlphanumeric).matches()); }
public static String createRandomAlphanumeric(final int length) { final Random r = ThreadLocalRandom.current(); final char[] randomChars = new char[length]; for (int i = 0; i < length; ++i) { randomChars[i] = ALPHANUMERICS[r.nextInt(ALPHANUMERICS.length)]; } return new String(randomChars); }
Utilities { public static String createRandomAlphanumeric(final int length) { final Random r = ThreadLocalRandom.current(); final char[] randomChars = new char[length]; for (int i = 0; i < length; ++i) { randomChars[i] = ALPHANUMERICS[r.nextInt(ALPHANUMERICS.length)]; } return new String(randomChars); } }
Utilities { public static String createRandomAlphanumeric(final int length) { final Random r = ThreadLocalRandom.current(); final char[] randomChars = new char[length]; for (int i = 0; i < length; ++i) { randomChars[i] = ALPHANUMERICS[r.nextInt(ALPHANUMERICS.length)]; } return new String(randomChars); } private  Utilities(); }
Utilities { public static String createRandomAlphanumeric(final int length) { final Random r = ThreadLocalRandom.current(); final char[] randomChars = new char[length]; for (int i = 0; i < length; ++i) { randomChars[i] = ALPHANUMERICS[r.nextInt(ALPHANUMERICS.length)]; } return new String(randomChars); } private  Utilities(); static boolean isNullOrEmptyString(final String value); static String createRandomAlphanumeric(final int length); static String createAlphanumericHash(final String str, final int length); static void generateInvocationIdIfNecessary(final TraceeBackend backend); static void generateSessionIdIfNecessary(final TraceeBackend backend, final String sessionId); }
Utilities { public static String createRandomAlphanumeric(final int length) { final Random r = ThreadLocalRandom.current(); final char[] randomChars = new char[length]; for (int i = 0; i < length; ++i) { randomChars[i] = ALPHANUMERICS[r.nextInt(ALPHANUMERICS.length)]; } return new String(randomChars); } private  Utilities(); static boolean isNullOrEmptyString(final String value); static String createRandomAlphanumeric(final int length); static String createAlphanumericHash(final String str, final int length); static void generateInvocationIdIfNecessary(final TraceeBackend backend); static void generateSessionIdIfNecessary(final TraceeBackend backend, final String sessionId); static final Charset CHARSET_UTF8; }