Class MValidator


  • public class MValidator
    extends Object
    • Constructor Detail

      • MValidator

        public MValidator()
    • 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)
      • getPasswordList

        public static List<String> getPasswordList()
      • isZipCode

        public static boolean isZipCode​(Locale locale,
                                        String zip)
      • isUUID

        public static boolean isUUID​(String id)
      • isPhoneNumber

        public static boolean isPhoneNumber​(String phone)
      • isPhoneNumber

        public static boolean isPhoneNumber​(String phone,
                                            Locale locale)
      • 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