@@ -0,0 +1,1125 @@
+/**%0A * %3Cp%3EProject name is RoomieS%3Cbr%3E%0A * Package name is com.faveroomies.security%3Cbr%3E%0A * File name is ConfirmationCode.java%3Cbr%3E%0A *%0A * @author YeonGyu Yang%0A * @since May 6, 2016%0A */%0Apackage com.faveroomies.security;%0A%0Aimport java.util.Random;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A/**%0A * %0A * @author YeonGyu Yang%0A * @Since May 6, 2016%0A *%0A */%0Apublic class CodeGenerator %7B%0A%0A%09private Logger logger = LoggerFactory.getLogger(CodeGenerator.class);%0A%0A%09private Random r = new Random();%0A%09private StringBuffer code = new StringBuffer();%0A%0A%09public String generator() %7B%0A%0A%09%09logger.info(%22Code Generator%22);%0A%0A%09%09int type = 0;%0A%0A%09%09for (int i = 0; i %3C= 12; i++) %7B%0A%09%09%09type = r.nextInt(3);%0A%0A%09%09%09// Upper%0A%09%09%09if (type == 0) %7B%0A%09%09%09%09logger.info(%22Type : Upper letters%22);%0A%09%09%09%09code.append((char) (65 + r.nextInt(25)));%0A%09%09%09%7D else if (type == 1) %7B // Lower%0A%09%09%09%09logger.info(%22Type : Lower letters%22);%0A%09%09%09%09code.append((char) (97 + r.nextInt(25)));%0A%09%09%09%7D else if (type == 2) %7B// Number%0A%09%09%09%09logger.info(%22Type : Number%22);%0A%09%09%09%09code.append(r.nextInt(10));%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09logger.info(%22Code : %22 + code.toString());%0A%09%09%7D%0A%09%09%0A%09%09return code.toString();%0A%0A%09%7D%0A%0A%7D%0A

Create Model