Enum Class MaskType

java.lang.Object
java.lang.Enum<MaskType>
cn.mindit.atom.core.util.MaskType
All Implemented Interfaces:
Serializable, Comparable<MaskType>, Constable

public enum MaskType extends Enum<MaskType>
Since:
2023-08-25
Author:
Catch
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    地址, 只显示到地区,不显示详细地址,比如:北京市海淀区****
    银行卡号, 只显示后4位, 如:**** **** **** 3728
    车牌中间用*代替
    自定义, 自定义 [start, end) 字符为 *
    邮箱, 前缀仅显示第一个字母,前缀其他隐藏,用星号代替,@及后面的地址显示,比如:d**@126.com
    座机号, 只显示前4位和后2位,如 0379*****12
    ID, 不对外提供id, 统一都为 0
    身份证号, 只显示前3位和后4位,如 410***********1234
    IPv4 ,如:脱敏前:192.168.1.1;脱敏后:192
    IPv6,如:脱敏前:2001:0db8:86a3:08d3:1319:8a2e:0370:7344;脱敏后:2001:*:*:*:*:*:*:*
    姓名, 只显示第1位,如 李*, 王**
    密码, 全部字符都用*代替,比如:******
    手机号, 只显示手机号前3位和后4位,如 138****1234
  • Method Summary

    Modifier and Type
    Method
    Description
    static MaskType
    Returns the enum constant of this class with the specified name.
    static MaskType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • CUSTOM

      public static final MaskType CUSTOM
      自定义, 自定义 [start, end) 字符为 *
    • NAME

      public static final MaskType NAME
      姓名, 只显示第1位,如 李*, 王**
    • PHONE

      public static final MaskType PHONE
      手机号, 只显示手机号前3位和后4位,如 138****1234
    • ID_CARD

      public static final MaskType ID_CARD
      身份证号, 只显示前3位和后4位,如 410***********1234
    • BANK_CARD

      public static final MaskType BANK_CARD
      银行卡号, 只显示后4位, 如:**** **** **** 3728
    • EMAIL

      public static final MaskType EMAIL
      邮箱, 前缀仅显示第一个字母,前缀其他隐藏,用星号代替,@及后面的地址显示,比如:d**@126.com
    • PASSWORD

      public static final MaskType PASSWORD
      密码, 全部字符都用*代替,比如:******
    • FIXED_PHONE

      public static final MaskType FIXED_PHONE
      座机号, 只显示前4位和后2位,如 0379*****12
    • ADDRESS

      public static final MaskType ADDRESS
      地址, 只显示到地区,不显示详细地址,比如:北京市海淀区****
    • ID

      public static final MaskType ID
      ID, 不对外提供id, 统一都为 0
    • CAR_LICENSE

      public static final MaskType CAR_LICENSE
      车牌中间用*代替

      eg1:null -》 ""

      eg2:"" -》 ""

      eg3:苏D40000 -》 苏D4***0

      eg4:陕A12345D -》 陕A1****D

      eg5:京A123 -》 京A123 如果是错误的车牌,不处理

    • IPV4

      public static final MaskType IPV4
      IPv4 ,如:脱敏前:192.168.1.1;脱敏后:192.*.*.*
    • IPV6

      public static final MaskType IPV6
      IPv6,如:脱敏前:2001:0db8:86a3:08d3:1319:8a2e:0370:7344;脱敏后:2001:*:*:*:*:*:*:*
  • Method Details

    • values

      public static MaskType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MaskType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null