This repository was archived by the owner on Nov 21, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/main/java/org/code4everything/boot/base/bean Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
public interface BaseBean {
18
18
19
+ /**
20
+ * 初始化对象,调用者需重写此方法并手动调用
21
+ *
22
+ * @since 1.1.6
23
+ */
24
+ default void init () {}
25
+
19
26
/**
20
27
* 将空指针的属性设为默认值
21
28
*
@@ -83,7 +90,7 @@ default void requireNonNullProperty() {
83
90
Field [] fields = ReflectUtil .getFields (this .getClass ());
84
91
for (Field field : fields ) {
85
92
if (ObjectUtil .isNotNull (field ) && Objects .isNull (ReflectUtil .getFieldValue (this , field ))) {
86
- throw new NullPointerException ("the value of field '" + field .getName () + "' at class '" + this .getClass ().getName () + "' must not be null" );
93
+ throw new NullPointerException ("the value of field '" + field .getName () + "' in class '" + this .getClass ().getName () + "' must not be null" );
87
94
}
88
95
}
89
96
}
@@ -99,7 +106,7 @@ default void requireNonNullProperty() {
99
106
* @since 1.0.6
100
107
*/
101
108
default <T > T copyInto (T target ) {
102
- Objects .requireNonNull (target , "param must not be null" );
109
+ Objects .requireNonNull (target , "target must not be null" );
103
110
BeanUtil .copyProperties (this , target );
104
111
return target ;
105
112
}
You can’t perform that action at this time.
0 commit comments