fix parse bug

This commit is contained in:
Looly
2021-06-15 10:17:35 +08:00
parent 878c0169ea
commit 395942298e
7 changed files with 63 additions and 11 deletions

View File

@@ -10,7 +10,7 @@ import java.util.function.Supplier;
/**
* optional对象判空参考https://mp.weixin.qq.com/s/0c8iC0OTtx5LqPkhvkK0tw<br>
* fromhttps://github.com/looly/hutool/pull/1182
* fromhttps://github.com/dromara/hutool/pull/1182
*
* @param <T> Bean类型
* @author totalo
@@ -149,4 +149,4 @@ public final class OptionalBean<T> {
public int hashCode() {
return Objects.hashCode(value);
}
}
}

View File

@@ -13,7 +13,7 @@ public class OptionalBeanTest {
String value1 = OptionalBean.ofNullable(user)
.getBean(User::getSchool)
.getBean(User.School::getAddress).get();
Assert.assertNull(value1);
Assert.assertNull(value1);
boolean present = OptionalBean.ofNullable(user)
.getBean(User::getSchool)