File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -147,8 +147,7 @@ SomeObject clone = cloner.clone(original);
147
147
148
148
#### Creating shallow copy
149
149
150
- If you wish to create a shallow copy of an object, i. e. another object which references same children as the original,
151
- you may do :
150
+ If you wish to create a shallow copy of an object, i. e. another object which references same children as the original, you may do :
152
151
153
152
```java
154
153
Cloner cloner = Cloners . builder()
@@ -157,6 +156,15 @@ Cloner cloner = Cloners.builder()
157
156
SomeObject clone = cloner. clone(original);
158
157
```
159
158
159
+ If you want to have deep cloning by default and shallow cloning of all instances of `SomeObject `, you may do :
160
+
161
+ ```java
162
+ Cloner cloner = Cloners . builder()
163
+ .shallow(SomeObject . class)
164
+ .build();
165
+ ```
166
+
167
+
160
168
### Customization
161
169
162
170
```java
You can’t perform that action at this time.
0 commit comments