Java Utililty Methods Random Name

List of utility methods to do Random Name

Description

The list of methods to do Random Name are organized into topic(s).

Method

StringgetRandomFileName()
get Random File Name
String fileName = "";
java.util.Date dt = new java.util.Date(System.currentTimeMillis());
SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmssSSS");
fileName = fmt.format(dt);
return fileName;
StringgetRandomName()
get Random Name
DateFormat format = new SimpleDateFormat("yyMMddHHmmss");
String formatDate = format.format(new Date());
int random = new Random().nextInt(10000);
return formatDate + random;
StringgetRandomName()
get Random Name
return NAMES[random.nextInt(NAMES.length)];
StringgetRandomName()
get Random Name
return firstParts[theRandom.nextInt(firstParts.length - 1)]
        + secondParts[theRandom.nextInt(secondParts.length - 1)];
StringrandomFileName()
random File Name
return FILE_PREFIX + ((int) (Math.random() * Integer.MAX_VALUE)) + FILE_SUFFIX;
StringrandomFilename()
random Filename
return System.currentTimeMillis() + ("" + Math.random()).replaceAll("\\.", "");
StringrandomIndexName()
random Index Name
return "index-" + System.currentTimeMillis();
StringrandomName()
Return a generated short, random string
return "TMP_" + next++;
StringrandomName()
random Name
String[] simple = { "an", "ao", "andy", "apple", "blue", "boy", "ben", "bob", "black", "cold", "code",
        "color", "cream", "cindy", "doctor", "dany", "dog", "dick", "egg", "easy", "editor", "fox", "fade",
        "fall", "fancy", "green", "gentle", "good", "glass", "happy", "half", "hard", "holidy", "jack",
        "jade", "jeep", "july", "kid", "kind", "king", "killer", "lucky", "luck", "looser", "lord", "mm",
        "moon", "magic", "music", "note", "noah", "nil", "nut", "orange", "open", "ok", "old", "pop",
        "park", "painter", "print", "queen", "quite", "quake", "quail", "red", "rapid", "rabbit", "rose",
        "soul", "saga", "sailor", "soldier", "tiger", "tag", "trick", "touch", "UFO", "guly", "under",
        "user", "victor", "visitor", "visual", "void", "world", "wise", "wide", "water", "x-ray", "x",
...
StringrandomName()
random Name
return names[(int) (Math.random() * names.length)] + " " + names[(int) (Math.random() * names.length)];