Skip to content

Commit 81dae9c

Browse files
committed
docs: omit fields by class type #121
1 parent fd8b4c1 commit 81dae9c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ TestDto:
162162
- myPrivateField: String: null
163163
- myPublicField: int: 0
164164

165+
### Omit all fields for type
166+
```java
167+
var result = fixture.build(TestDto.class)
168+
.without(String.class)
169+
.without(int.class)
170+
.create();
171+
```
172+
#### Sample Result
173+
TestDto:
174+
- myPrivateField: String: null
175+
- myPublicField: int: 0
176+
165177
#### Note
166178
Primitives will receive their default-value, classes will be `null`.
167179

0 commit comments

Comments
 (0)