@Test public void testGenerateID() { Long result = MotechIDGenerator.generateID(MotechIDGenerator.DEFUALT_ID_LENGTH); System.out.println("ID: " + result); assertNotNull(result); }
public static Long generateID(int length) { logger.info("Calling generateID with specify length"); Long result = null; if (length > 0) { StringBuilder id = new StringBuilder(length); for (int i = 0; i < length; i++) { id.append(NUMS[(int) Math.floor(Math.random() * 20)]); } result = Long.parseLong(id.toString()); } return result; }
MotechIDGenerator { public static Long generateID(int length) { logger.info("Calling generateID with specify length"); Long result = null; if (length > 0) { StringBuilder id = new StringBuilder(length); for (int i = 0; i < length; i++) { id.append(NUMS[(int) Math.floor(Math.random() * 20)]); } result = Long.parseLong(id.toString()); } return result; } }
MotechIDGenerator { public static Long generateID(int length) { logger.info("Calling generateID with specify length"); Long result = null; if (length > 0) { StringBuilder id = new StringBuilder(length); for (int i = 0; i < length; i++) { id.append(NUMS[(int) Math.floor(Math.random() * 20)]); } result = Long.parseLong(id.toString()); } return result; }  }
MotechIDGenerator { public static Long generateID(int length) { logger.info("Calling generateID with specify length"); Long result = null; if (length > 0) { StringBuilder id = new StringBuilder(length); for (int i = 0; i < length; i++) { id.append(NUMS[(int) Math.floor(Math.random() * 20)]); } result = Long.parseLong(id.toString()); } return result; }  static Long generateID(int length); static Long generateID(); static String generateUUID(); }
MotechIDGenerator { public static Long generateID(int length) { logger.info("Calling generateID with specify length"); Long result = null; if (length > 0) { StringBuilder id = new StringBuilder(length); for (int i = 0; i < length; i++) { id.append(NUMS[(int) Math.floor(Math.random() * 20)]); } result = Long.parseLong(id.toString()); } return result; }  static Long generateID(int length); static Long generateID(); static String generateUUID(); static final int DEFUALT_ID_LENGTH; }