public String next ( int maxTries ) { for ( int i = 1 ; i <= maxTries ; ++ i ) { val sb = new StringBuilder ( 32 ) . append ( Math . abs ( r . nextLong ( ) ) ) ; val s = Strs . fixedLength ( sb , len ) . toString ( ) ; if ( filter . add ( s ) ) return s ; } throw new RuntimeException ( "try out times" ) ; }
Thread - safe method to get next random voucher no .