Package de.mhus.lib.core
Class MValidator
- java.lang.Object
-
- de.mhus.lib.core.MValidator
-
public class MValidator extends Object
-
-
Constructor Summary
Constructors Constructor Description MValidator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>getPasswordList()static booleanisAddress(String in)static booleanisAZ09(String in)Check if in consists of a-z A-Z 0-9static booleanisEmailAddress(String email)static booleanisFilePath(String in)Checks if the path is a posix but also for windows systems.static booleanisFirstName(String in)International name.static booleanisInteger(String nr)static booleanisIPv4(String ip)static booleanisLastName(String in)International name.static booleanisNumber(String nr)static booleanisPassword(String in, int maxLen, boolean needNumbers, boolean needSpecials, String... weakContent)static booleanisPhoneNumber(String phone)static booleanisPhoneNumber(String phone, Locale locale)static booleanisPosixFileName(String in)Checks if the file only contains Posix characters.static booleanisPosixFilePath(String in)Checks if the path is a posix compatible path.static booleanisUUID(String id)static booleanisZipCode(Locale locale, String zip)
-
-
-
Method Detail
-
isEmailAddress
public static boolean isEmailAddress(String email)
-
isFirstName
public static boolean isFirstName(String in)
International name. This is a simple test and should be extended ... What about: - names with only upper chars. - Ann-Sophie- Parameters:
in-- Returns:
- true if it's a first name
-
isLastName
public static boolean isLastName(String in)
International name. This is a simple test and should be extended ... What about: - DIETER-FILSINGER (should fail, only upper chars) - "King, Jr." (Allowed in a strict matter?, "Jr" is not part of the name.) - Dieter-Filsinger (should pass, Not only upper chars but more then the first one) - DieTer-Filsinger (Should fail) - Van Gerben (Space in the name)- Parameters:
in-- Returns:
- true if it's a last name
-
isAddress
public static boolean isAddress(String in)
-
isPassword
public static boolean isPassword(String in, int maxLen, boolean needNumbers, boolean needSpecials, String... weakContent)
-
isUUID
public static boolean isUUID(String id)
-
isPhoneNumber
public static boolean isPhoneNumber(String phone)
-
isNumber
public static boolean isNumber(String nr)
-
isInteger
public static boolean isInteger(String nr)
-
isIPv4
public static boolean isIPv4(String ip)
-
isAZ09
public static boolean isAZ09(String in)
Check if in consists of a-z A-Z 0-9- Parameters:
in-- Returns:
- true if matches
-
isPosixFileName
public static boolean isPosixFileName(String in)
Checks if the file only contains Posix characters. Path separators are not allowed. Only - _ . A-Z a-z 0-9 are allowed.- Parameters:
in-- Returns:
- true if it's posix
-
isPosixFilePath
public static boolean isPosixFilePath(String in)
Checks if the path is a posix compatible path. The home tilde is not allowed. Only - _ . A-Z a-z 0-9 and slash for path separation are allowed.- Parameters:
in-- Returns:
- true fi it's posix
-
isFilePath
public static boolean isFilePath(String in)
Checks if the path is a posix but also for windows systems. Only - _ . A-Z a-z 0-9 and slash, back slash and : for path separation are allowed.- Parameters:
in-- Returns:
- true if the path is valid
-
-