mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix comment
This commit is contained in:
parent
496d07c8d7
commit
7ece10a15d
@ -253,8 +253,10 @@ public class Opt<T> {
|
||||
* String hutool = Opt.ofBlankAble("hutool").mapOrElse(String::toUpperCase, () -> Console.log("yes")).mapOrElse(String::intern, () -> Console.log("Value is not present~")).get();
|
||||
* }</pre>
|
||||
*
|
||||
* @param <U> map后新的类型
|
||||
* @param mapper 包裹里的值存在时的操作
|
||||
* @param emptyAction 包裹里的值不存在时的操作
|
||||
* @return 新的类型的Opt
|
||||
* @throws NullPointerException 如果包裹里的值存在时,执行的操作为 {@code null}, 或者包裹里的值不存在时的操作为 {@code null},则抛出{@code NPE}
|
||||
*/
|
||||
public <U> Opt<U> mapOrElse(Function<? super T, ? extends U> mapper, VoidFunc0 emptyAction) {
|
||||
|
@ -154,7 +154,7 @@ public class IdcardUtil {
|
||||
* @return 是否有效
|
||||
*/
|
||||
public static boolean isValidCard(String idCard) {
|
||||
if(StrUtil.isBlank(idCard)){
|
||||
if (StrUtil.isBlank(idCard)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -201,9 +201,7 @@ public class IdcardUtil {
|
||||
* <li>余数只可能有0 1 2 3 4 5 6 7 8 9 10这11个数字。其分别对应的最后一位身份证的号码为1 0 X 9 8 7 6 5 4 3 2</li>
|
||||
* <li>通过上面得知如果余数是2,就会在身份证的第18位数字上出现罗马数字的Ⅹ。如果余数是10,身份证的最后一位号码就是2</li>
|
||||
* </ol>
|
||||
*
|
||||
<p>
|
||||
* <ol>
|
||||
* <ol>
|
||||
* <li>香港人在大陆的身份证,【810000】开头;同样可以直接获取到 性别、出生日期</li>
|
||||
* <li>81000019980902013X: 文绎循 男 1998-09-02</li>
|
||||
* <li>810000201011210153: 辛烨 男 2010-11-21</li>
|
||||
@ -218,7 +216,6 @@ public class IdcardUtil {
|
||||
* <li>830000194609150010: 苏建文 男 1946-09-14</li>
|
||||
* <li>83000019810715006X: 刁婉琇 女 1981-07-15</li>
|
||||
* </ol>
|
||||
* </p>
|
||||
*
|
||||
* @param idcard 待验证的身份证
|
||||
* @return 是否有效的18位身份证,忽略x的大小写
|
||||
@ -255,7 +252,7 @@ public class IdcardUtil {
|
||||
* <li>通过上面得知如果余数是2,就会在身份证的第18位数字上出现罗马数字的Ⅹ。如果余数是10,身份证的最后一位号码就是2</li>
|
||||
* </ol>
|
||||
*
|
||||
* @param idcard 待验证的身份证
|
||||
* @param idcard 待验证的身份证
|
||||
* @param ignoreCase 是否忽略大小写。{@code true}则忽略X大小写,否则严格匹配大写。
|
||||
* @return 是否有效的18位身份证
|
||||
* @since 5.5.7
|
||||
@ -576,7 +573,7 @@ public class IdcardUtil {
|
||||
*/
|
||||
public static String getProvinceByIdCard(String idcard) {
|
||||
final String code = getProvinceCodeByIdCard(idcard);
|
||||
if(StrUtil.isNotBlank(code)){
|
||||
if (StrUtil.isNotBlank(code)) {
|
||||
return CITY_CODES.get(code);
|
||||
}
|
||||
return null;
|
||||
@ -617,7 +614,7 @@ public class IdcardUtil {
|
||||
* @return {@link Idcard}
|
||||
* @since 5.4.3
|
||||
*/
|
||||
public static Idcard getIdcardInfo(String idcard){
|
||||
public static Idcard getIdcardInfo(String idcard) {
|
||||
return new Idcard(idcard);
|
||||
}
|
||||
|
||||
@ -761,6 +758,7 @@ public class IdcardUtil {
|
||||
|
||||
/**
|
||||
* 获取年龄
|
||||
*
|
||||
* @return 年龄
|
||||
*/
|
||||
public int getAge() {
|
||||
|
Loading…
Reference in New Issue
Block a user