package com.nestedworld.nestedworld.helpers.input;


import android.support.annotation.NonNull;
import android.text.TextUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public final class InputChecker {

    private final static int SHORTEST_PASSWORD_LENGTH = 6;

    /*
    ** Constructor
     */
    private InputChecker() {
        //Empty constructor for avoiding this class to be construct
    }

    /*
    ** Public method
     */
    public static boolean checkEmailFormat(@NonNull final String email) {
        boolean isValid = false;

        final String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$";

        final Pattern pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE);
        final Matcher matcher = pattern.matcher(email);
        if (matcher.matches()) {
            isValid = true;
        }
        return isValid;
    }

    public static boolean checkPasswordFormat(@NonNull final String password) {
        return !TextUtils.isEmpty(password) && password.length() >= SHORTEST_PASSWORD_LENGTH;
    }
}

@@ -1065,10 +1065,139 @@
 ;%0A    %7D%0A
+%0A    public static boolean checkPseudoFormat(@NonNull final String password) %7B%0A        return !TextUtils.isEmpty(password);%0A    
 %7D%0A
+%7D

enhance inputChecker