package cn.momia.common.core.util;

import org.apache.commons.lang3.StringUtils;

import java.util.regex.Pattern;

public class MomiaUtil {
    private static final Pattern MOBILE_PATTERN = Pattern.compile("^1[0-9]{10}$");

    public static boolean isInvalid(String mobile) {
        if (StringUtils.isBlank(mobile)) return true;
        return !MOBILE_PATTERN.matcher(mobile).find();
    }

    public static String encrypt(String mobile) {
        if (isInvalid(mobile)) return "";
        return mobile.substring(0, 3) + "****" + mobile.substring(7);
    }
}

@@ -252,16 +252,22 @@
 sInvalid
+Mobile
 (String 
@@ -424,16 +424,22 @@
  encrypt
+Mobile
 (String 
@@ -469,16 +469,22 @@
 sInvalid
+Mobile
 (mobile)

rename method