Class ValidationUtils


  • public class ValidationUtils
    extends java.lang.Object
    Utility class to validate various inputs.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isValidEmail​(java.lang.String email)
      Checks if the provided email is as valid email.
      static boolean isValidPhoneNo​(java.lang.String phoneNo)
      Checks if the provided phone number is a valid phone number.
      static boolean isValidUsername​(java.lang.String username)
      Checks if the provided username is a valid username that is between lengths 1-20 inclusive.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isValidUsername

        public static boolean isValidUsername​(java.lang.String username)
        Checks if the provided username is a valid username that is between lengths 1-20 inclusive.
        Parameters:
        username - username to check
        Returns:
        if the username is valid
      • isValidPhoneNo

        public static boolean isValidPhoneNo​(java.lang.String phoneNo)
        Checks if the provided phone number is a valid phone number.
        Parameters:
        phoneNo - phone number to check
        Returns:
        if the phone number is valid
      • isValidEmail

        public static boolean isValidEmail​(java.lang.String email)
        Checks if the provided email is as valid email.
        Parameters:
        email - email to check
        Returns:
        if the email is valid