整理一下以后开发需要用的工具类--UUID
import java.util.UUID; /** * Title:uuidUtil * @Param: * @Return:uuid * @author:YuMing * @Date:2017-12-28上午9:42:06 */ public class uuidUtil { /** * Title:String * @Description: TODO * @Param: * @Return: common uuid * @throws: * @author:YuMing * @Date:2017-12-28上午9:42:42 * @return */ public static String uuid(){ return UUID.randomUUID().toString(); } /** * Title:String * @Description: TODO * @Param: * @Return:replace - uuid * @throws: * @author:YuMing * @Date:2017-12-28上午9:43:51 * @return */ public static String uuidReplace(){ return UUID.randomUUID().toString().replace("-", ""); } }
效果如下:
f8090620-60a5-4243-8696-ee171ef7e972 83ac0a5648804472ace984216794ee79