Java UUID Create generate()

Here you can find the source of generate()

Description

generate

License

LGPL

Declaration

public static String generate() 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.util.UUID;

public class Main {
    public static String generate() {
        return generate(false);
    }//from   w w w. j a  va 2  s. c o  m

    public static String generate(boolean withSeparator) {
        String uuid = UUID.randomUUID().toString();
        if (!withSeparator) {
            uuid = uuid.replace("-", "");
        }
        return uuid;
    }
}

Related

  1. generate()
  2. generate()
  3. generate()
  4. generateApiAccesskeyId()