Java UUID Create generateEmailPrefix()

Here you can find the source of generateEmailPrefix()

Description

generate Email Prefix

License

Open Source License

Declaration

public static String generateEmailPrefix() 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2010-2012 by Min Cai (min.cai.china@gmail.com).
 *
 * This file is part of the PickaPack library.
 *
 * PickaPack is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.//from  ww w. j  ava  2 s .  co m
 *
 * PickaPack is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PickaPack. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/

import java.util.Random;
import java.util.UUID;

public class Main {
    private static Random random = new Random();

    /**
     *
     * @return
     */
    public static String generateEmailPrefix() {
        return (char) (97 + random.nextInt(122 - 97))
                + UUID.randomUUID().toString().substring(0, 5 + random.nextInt(10)).replaceAll("-", "");
    }
}

Related

  1. generateClientId()
  2. generateConnectionId()
  3. generateConsumerName(String serverInstanceId)
  4. generateContentID()
  5. generateCurrentTimestampUUID()
  6. generateFakedDeviceTokenString()
  7. generateFileName(String path)
  8. generateGUID()
  9. generateGUID()