public class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
AB
Base string to generate random alphanumeric strings
|
static Random |
rnd
Random generator
|
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkDniLetter(String n) |
static boolean |
connectionAvailable(Context ctx)
Checks if any connection is available
|
static String |
fixLinks(String body) |
static String |
getSeenNotificationCodes(List<Model> markedNotificationsList)
Creates a string of notification codes separated by commas from a list of notifications
|
static String |
getStarsSequence(int size)
Generates the stars sequence to be showed on password field
|
static boolean |
isHTTPUrl(String url) |
static boolean |
isInteger(String str) |
static boolean |
isLong(String str) |
static boolean |
isValidDni(String dni) |
static boolean |
isValidNickname(String nickname) |
static int |
parseBoolInt(boolean b)
Function to parse from Boolean to Integer
|
static String |
parseBoolString(boolean b)
Function to parse from Boolean to String
|
static boolean |
parseIntBool(int n)
Function to parse from Integer to Boolean
|
static boolean |
parseStringBool(String s)
Function to parse from String to Boolean
|
static String |
randomString(int len)
Generates a random string of length len
|
static String |
unAccent(String s) |
public static final Random rnd
public static final String AB
public static String randomString(int len)
len
- Length of random stringpublic static boolean connectionAvailable(Context ctx)
ctx
- Application contextpublic static boolean parseIntBool(int n)
n
- Integer to be parsedpublic static boolean parseStringBool(String s)
s
- String to be parsedpublic static int parseBoolInt(boolean b)
b
- Boolean to be parsedpublic static String parseBoolString(boolean b)
b
- Boolean to be parsedpublic static boolean isHTTPUrl(String url)
public static boolean isInteger(String str)
public static boolean isLong(String str)
public static boolean isValidDni(String dni)
public static boolean checkDniLetter(String n)
public static boolean isValidNickname(String nickname)
public static String getSeenNotificationCodes(List<Model> markedNotificationsList)
public static String getStarsSequence(int size)
size
- Length of the stars sequence