Skip to content

Commit d6e7e8e

Browse files
author
Maxim Butov
committed
Documentation.
1 parent 42224ec commit d6e7e8e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ SomeObject clone = cloner.clone(original);
147147

148148
#### Creating shallow copy
149149

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:
152151

153152
```java
154153
Cloner cloner = Cloners.builder()
@@ -157,6 +156,15 @@ Cloner cloner = Cloners.builder()
157156
SomeObject clone = cloner.clone(original);
158157
```
159158

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+
160168
### Customization
161169

162170
```java

0 commit comments

Comments
 (0)