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 String generateRandomString() {
    return UUID.randomUUID().toString();
}

From source file:Main.java

private static String getFileName() {
    String uuid = UUID.randomUUID().toString();
    return "/" + uuid + ".png";
}

From source file:Main.java

public static String gainUUID() {
    String strUUID = UUID.randomUUID().toString();
    strUUID = strUUID.replaceAll("-", "").toLowerCase();
    return strUUID;
}

From source file:Main.java

public static String makeUuidUrn() {
    return "urn:uuid:" + UUID.randomUUID().toString().toLowerCase();
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static String getUUID() {
    String[] str = UUID.randomUUID().toString().split("-");
    String uuidStr = "";
    for (String s : str) {
        uuidStr += s;/*w ww .ja v a 2 s .co  m*/
    }
    return uuidStr;
}

From source file:Main.java

public static String getUUIDRandomString() {
    UUID uuid = UUID.randomUUID();
    return uuid.toString();
}

From source file:Main.java

public static String get32RandomString() {
    UUID uuid = UUID.randomUUID();
    String uuidStr = uuid.toString().replace("-", "");

    return uuidStr;
}

From source file:Main.java

public static String getUUIDString() {
    String UUIDString = UUID.randomUUID().toString();
    String newUUIDString = UUIDString.replace("-", "");
    String substring = newUUIDString.substring(0, 10);
    return substring;
}