Enum Class JsonMask.MaskType
- All Implemented Interfaces:
Serializable, Comparable<JsonMask.MaskType>, Constable
- Enclosing class:
JsonMask
Mask type enumeration
脱敏类型枚举
- Since:
- JDK 25, opencode-base-json V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAddress masking - detailed address hidden.Bank card masking - middle digits hidden.Custom masking with regex pattern.Email masking - username partially hidden.Full masking - entire value hidden.ID card masking - middle digits hidden.Name masking - surname visible, given name hidden.Password masking - all characters replaced with *.Phone number masking - middle 4 digits hidden. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonMask.MaskTypeReturns the enum constant of this class with the specified name.static JsonMask.MaskType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PASSWORD
Password masking - all characters replaced with *. 密码脱敏 - 所有字符替换为 *。Example: "password123" -> "******"
-
PHONE
Phone number masking - middle 4 digits hidden. 手机号脱敏 - 中间4位隐藏。Example: "13812345678" -> "138****5678"
-
ID_CARD
ID card masking - middle digits hidden. 身份证号脱敏 - 中间位数隐藏。Example: "110101199001011234" -> "110***********1234"
-
EMAIL
Email masking - username partially hidden. 邮箱脱敏 - 用户名部分隐藏。Example: "test@example.com" -> "t***@example.com"
-
BANK_CARD
Bank card masking - middle digits hidden. 银行卡脱敏 - 中间位数隐藏。Example: "6222021234567890123" -> "6222****0123"
-
NAME
Name masking - surname visible, given name hidden. 姓名脱敏 - 姓可见,名隐藏。Example: "张三丰" -> "张**"
-
ADDRESS
Address masking - detailed address hidden. 地址脱敏 - 详细地址隐藏。Example: "北京市朝阳区xxx街道" -> "北京市朝阳区****"
-
CUSTOM
Custom masking with regex pattern. 使用正则表达式的自定义脱敏。 -
FULL
Full masking - entire value hidden. 完全脱敏 - 整个值隐藏。Example: "anything" -> "******"
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-