]> git.mxchange.org Git - juser-activity-core.git/commitdiff
added method generateRandomName() which generates a pseudo-random user name: user...
authorRoland Häder <roland@mxchange.org>
Thu, 12 May 2016 12:06:37 +0000 (14:06 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 12 May 2016 12:06:37 +0000 (14:06 +0200)
src/org/mxchange/jusercore/model/user/UserUtils.java

index daa47e82df415c0cfade5d38d9aef931e87b66d6..81749b3f5158893175f13c2d9d30e6ecf4a63f8f 100644 (file)
@@ -188,6 +188,19 @@ public class UserUtils implements Serializable {
                return encryptedPassword.equals(container.getUser().getUserEncryptedPassword());
        }
 
+       /**
+        * Generates a pseudo-random user name
+        * <p>
+        * @return User name
+        */
+       public static String generateRandomUserName () {
+               // User name's format is normally "user" + random number (10 digits)
+               String userName = String.format("user%d", RANDOM_NUMBER_GENERATOR.nextInt(10000000)); //NOI18N
+
+               // Return it
+               return userName;
+       }
+
        /**
         * No instance from this class
         */