UPDATE - RequestHelper, make static methods
This commit is contained in:
parent
883173a2fc
commit
a5e1d71532
@ -9,8 +9,8 @@ import java.util.concurrent.ThreadLocalRandom;
|
||||
*/
|
||||
public class RequestHelper {
|
||||
|
||||
private final String ALPHANUMERIC_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
private final int baseCharacterLen = ALPHANUMERIC_CHARACTERS.length();
|
||||
private final static String ALPHANUMERIC_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
private final static int baseCharacterLen = ALPHANUMERIC_CHARACTERS.length();
|
||||
|
||||
|
||||
/**
|
||||
@ -34,7 +34,7 @@ public class RequestHelper {
|
||||
* @param len longitud de la cadena alfa-numerica a retornar
|
||||
* @return
|
||||
*/
|
||||
public String randomAlphanumeric(int len) {
|
||||
public static String randomAlphanumeric(int len) {
|
||||
char[] chars = new char[len];
|
||||
for (int i = 0; i < len; i++) {
|
||||
chars[i] = ALPHANUMERIC_CHARACTERS.charAt(ThreadLocalRandom.current().nextInt(baseCharacterLen));
|
||||
@ -64,7 +64,7 @@ public class RequestHelper {
|
||||
* @param instanceId
|
||||
* @return
|
||||
*/
|
||||
public String getRequestId(String instanceId) {
|
||||
public static String getRequestId(String instanceId) {
|
||||
return instanceId.concat("REQ").concat(randomAlphanumeric(20));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user