Created
September 11, 2014 14:39
-
-
Save laxman954/2141ff819ff17ccebe9a to your computer and use it in GitHub Desktop.
Randomly Generate Unique Id using UUID -Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.UUID; | |
/** | |
* @author lekshmana.murugan | |
* @since 2014-09-11 This RandomIDGeneration class Generate Unique id using UUID class is in | |
* util pacakage in Java Since version 1.5 | |
* @see http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html | |
*/ | |
public class RandomIDGeneration { | |
/** | |
* This method is used to Generate random unique id | |
* @return Randomly generate unique id, and converted into string. | |
*/ | |
public String generateRandomID() { | |
return UUID.randomUUID().toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment