public interface IDCardNumber
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_DISPLAY_END |
static int |
DEFAULT_DISPLAY_FRONT |
static char |
DEFAULT_REPLACED_CHAR |
| Modifier and Type | Method and Description |
|---|---|
default int |
getAge()
计算年龄
|
LocalDate |
getBirthDate()
获取出生日期
|
Gender |
getGender()
根据身份证号判断性别
|
default String |
toDesensitizedString()
脱敏字符串(前面留 1 位,后面留 2 位)
|
default String |
toDesensitizedString(char replacedChar,
int front,
int end)
脱敏字符串
|
default String |
toDesensitizedString(int front,
int end)
脱敏字符串
|
String |
value()
身份证号
|
static final char DEFAULT_REPLACED_CHAR
static final int DEFAULT_DISPLAY_FRONT
static final int DEFAULT_DISPLAY_END
String value()
LocalDate getBirthDate()
default int getAge()
default String toDesensitizedString()
default String toDesensitizedString(int front, int end)
front - 前面保留的字符数end - 后面保留的字符数default String toDesensitizedString(char replacedChar, int front, int end)
replacedChar - 替换字符front - 前面保留的字符数end - 后面保留的字符数Copyright © 2026. All rights reserved.