All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cookercucumber_parser.fileGenerationFactory.RandomNumberGenerator Maven / Gradle / Ivy

Go to download

Derives smallest Feature File, Allows Data from Excel(xls and xlsx) and Also provides a clear and concise reporting

There is a newer version: 3.1.0
Show newest version
package cookercucumber_parser.fileGenerationFactory;

public class RandomNumberGenerator {

    /**
     * This method is used to get the random number between AA to ZZ and 0001 to 9999 (XX8888)
     * 
Author : Manjunath Prabhakar ([email protected])
* * @return : formatted random number */ public static String genRandomNumber() { int minNum = 1, maxNum = 9999; int random = (int) (Math.random() * maxNum + minNum); String formattedRandomNum = String.format("%04d", random); final String ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int alpharandom1 = (int) (Math.random() * 25 + 0); int alpharandom2 = (int) (Math.random() * 25 + 0); String res = "" + ALPHA.charAt(alpharandom1) + ALPHA.charAt(alpharandom2) + formattedRandomNum; return res; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy