Enum Class JsonMask.MaskType

java.lang.Object
java.lang.Enum<JsonMask.MaskType>
cloud.opencode.base.json.annotation.JsonMask.MaskType
All Implemented Interfaces:
Serializable, Comparable<JsonMask.MaskType>, Constable
Enclosing class:
JsonMask

public static enum JsonMask.MaskType extends Enum<JsonMask.MaskType>
Mask type enumeration 脱敏类型枚举
Since:
JDK 25, opencode-base-json V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Enum Constant Details

    • PASSWORD

      public static final JsonMask.MaskType PASSWORD
      Password masking - all characters replaced with *. 密码脱敏 - 所有字符替换为 *。

      Example: "password123" -> "******"

    • PHONE

      public static final JsonMask.MaskType PHONE
      Phone number masking - middle 4 digits hidden. 手机号脱敏 - 中间4位隐藏。

      Example: "13812345678" -> "138****5678"

    • ID_CARD

      public static final JsonMask.MaskType ID_CARD
      ID card masking - middle digits hidden. 身份证号脱敏 - 中间位数隐藏。

      Example: "110101199001011234" -> "110***********1234"

    • EMAIL

      public static final JsonMask.MaskType EMAIL
      Email masking - username partially hidden. 邮箱脱敏 - 用户名部分隐藏。

      Example: "test@example.com" -> "t***@example.com"

    • BANK_CARD

      public static final JsonMask.MaskType BANK_CARD
      Bank card masking - middle digits hidden. 银行卡脱敏 - 中间位数隐藏。

      Example: "6222021234567890123" -> "6222****0123"

    • NAME

      public static final JsonMask.MaskType NAME
      Name masking - surname visible, given name hidden. 姓名脱敏 - 姓可见,名隐藏。

      Example: "张三丰" -> "张**"

    • ADDRESS

      public static final JsonMask.MaskType ADDRESS
      Address masking - detailed address hidden. 地址脱敏 - 详细地址隐藏。

      Example: "北京市朝阳区xxx街道" -> "北京市朝阳区****"

    • CUSTOM

      public static final JsonMask.MaskType CUSTOM
      Custom masking with regex pattern. 使用正则表达式的自定义脱敏。
    • FULL

      public static final JsonMask.MaskType FULL
      Full masking - entire value hidden. 完全脱敏 - 整个值隐藏。

      Example: "anything" -> "******"

  • Method Details

    • values

      public static JsonMask.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 JsonMask.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