//----------------------------BEGIN LICENSE----------------------------
/* 
 * Willow : the Open Source WorkFlow Project
 * Distributable under GNU LGPL license by gun.org
 *
 * Copyright (C) 2004-2010 huihoo.org 
 * Copyright (C) 2004-2010  ZosaTapo <dertyang@hotmail.com> 
 * 
 * ====================================================================
 * Project Homepage : http://www.huihoo.org/god4j
 * Source Forge     : http://sourceforge.net/projects/huihoo
 * Mailing list     : god4j@lists.sourceforge.net 
 */
//----------------------------END  LICENSE-----------------------------
package org.huihoo.god4j.util;


public class UUID
{
	/** Noop constructor. */
	private UUID()
	{
	}
	/** Generate a Universal unique ID.
	    @return The id String
	 */
	public static String generate()
	{
		String id = UUIDGenerator.genRandomUUID();
		return id;
	}
	/** Generate a Universal unique ID if the specified ID is null or
	    an empty String.
	    @param id The current ID
	    @return The current ID or a new UUID
	 */
	public static String generate(String id)
	{
		if (id == null || id.equals(""))
		{
			return UUIDGenerator.genRandomUUID();
		}
		else
		{
			return id;
		}
	}
}
