Example usage for java.util UUID randomUUID

List of usage examples for java.util UUID randomUUID

Introduction

In this page you can find the example usage for java.util UUID randomUUID.

Prototype

public static UUID randomUUID() 

Source Link

Document

Static factory to retrieve a type 4 (pseudo randomly generated) UUID.

Usage

From source file:Main.java

public static UUID getVariableUUID() {
    return UUID.randomUUID();
}

From source file:Main.java

public static String generateUniqueKey() {
    return UUID.randomUUID().toString();
}

From source file:Main.java

public static String getUUID() {
    String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
    return uuid;// www  .j  a  v  a 2s .c o m
}

From source file:Main.java

public static String getUUID32() {
    UUID uuid = UUID.randomUUID();
    return uuid.toString().replaceAll("-", "");
}

From source file:Main.java

public static String getUUID() {
    String uuid = UUID.randomUUID().toString();
    return uuid.substring(0, 8) + uuid.substring(9, 13) + uuid.substring(14, 18) + uuid.substring(19, 23)
            + uuid.substring(24);//from   w  w w.  ja  v a  2  s . c o  m
}

From source file:Main.java

public static String getGUID() {
    String uuid = UUID.randomUUID().toString();
    String guid = uuid.replaceAll("-", "").toLowerCase() + System.currentTimeMillis();
    return guid;/*  w w w  .  ja va  2 s.c o m*/
}

From source file:Main.java

public static String getUUIDRandomNum() {
    return UUID.randomUUID().toString().replace("-", "").toUpperCase();
}

From source file:Main.java

private static String generateFileName() {
    return UUID.randomUUID().toString();
}

From source file:Main.java

private static String getMyUUID() {
    UUID uuid = UUID.randomUUID();
    String uniqueId = uuid.toString();
    return uniqueId;
}

From source file:Main.java

private static String generateRandomUUID() {
    return UUID.randomUUID().toString();
}