Enum Class DesensitizeType
- All Implemented Interfaces:
Serializable, Comparable<DesensitizeType>, Constable
Desensitize Type - Enum defining built-in desensitization types.
脱敏类型 - 定义内置脱敏类型的枚举。
Features | 主要功能:
- MOBILE_PHONE - 手机号脱敏
- ID_CARD - 身份证号脱敏
- EMAIL - 邮箱脱敏
- BANK_CARD - 银行卡号脱敏
- CHINESE_NAME - 中文姓名脱敏
- ADDRESS, PASSWORD, CUSTOM - 地址、密码、自定义脱敏
Usage Examples | 使用示例:
@Desensitize(DesensitizeType.MOBILE_PHONE)
private String phone;
String masked = OpenMask.desensitize("13812345678", DesensitizeType.MOBILE_PHONE);
Security | 安全性:
- Thread-safe: Yes (enum is immutable) - 线程安全: 是(枚举不可变)
- Since:
- JDK 25, opencode-base-string V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic DesensitizeTypeReturns the enum constant of this class with the specified name.static DesensitizeType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MOBILE_PHONE
-
ID_CARD
-
EMAIL
-
BANK_CARD
-
CHINESE_NAME
-
ADDRESS
-
PASSWORD
-
CUSTOM
-
-
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
-