Here you can find the source of generateId()
public static String generateId()
//package com.java2s; /******************************************************************************* * Copyright (c) 2015 Zend Technologies and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * // ww w . j ava2 s .co m * Contributors: * Zend Technologies - initial API and implementation *******************************************************************************/ import java.util.UUID; public class Main { /** * Generates and returns unique identifier with provided prefix. * * @param prefix * @return unique identifier with provided prefix */ public static String generateId(String prefix) { return prefix + '-' + UUID.randomUUID().toString(); } /** * Generates and returns unique identifier. * * @return unique identifier */ public static String generateId() { return UUID.randomUUID().toString(); } }