Class SensitiveUtil<T>

java.lang.Object
com.luna.common.sensitive.SensitiveUtil<T>

public class SensitiveUtil<T> extends Object
脱敏工具类 通过配置Config实现手机号电话,QQ微信邮箱,地址等脱敏开关 当Config全部是关闭状态时,调用不做任何操作
  • Method Details

    • apply

      public static <T> void apply(T data, Map<FieldType,FieldConfig> config)
      调用此方法进行脱敏
      Type Parameters:
      T -
      Parameters:
      data - 需要脱敏的数据
      config - 脱敏配置
      Throws:
      Exception
    • apply

      public static <T> void apply(T data)
    • parse

      public static <T> void parse(T data, Map<FieldType,FieldConfig> config, java.util.function.Function<String,FieldType> fieldTypeFunction)
      不使用注解的方式脱敏
      Type Parameters:
      T -
      Parameters:
      data -
      config -
      fieldTypeFunction -
      Throws:
      Exception
    • parse

      public static <T> void parse(T data, Map<FieldType,FieldConfig> config)
    • parse

      public static <T> void parse(T data, java.util.function.Function<String,FieldType> fieldTypeFunction)
    • parse

      public static <T> void parse(T data)
    • regexReplaceTelPhone

      public static String regexReplaceTelPhone(String string)
    • main

      public static void main(String[] args)
    • convert

      public void convert()
      开始做脱敏工作