Skip to content

Commit a208731

Browse files
jonpereiradevJonathan Pereira
authored andcommitted
README update.
1 parent 7b11c8b commit a208731

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Diff Objects
22

3-
This project helps you to build functionalities that needs to show the differences between two objects.
3+
This project helps you to build functionalities that needs to show the differences between two objects. You can use
4+
this project in two ways:
45

5-
You can use this project in two ways, using annotations or a Builder to map the properties of the object that will be
6-
checked for difference.
6+
- using the annotations @DiffMappings, @DiffMapping and @DiffProperty;
7+
- using the DiffBuilder to map the properties of a class;
78

89
## DiffBuilder
910

10-
The DiffBuilder provide an API to map an object without the use of annotations:
11+
The DiffBuilder provides an API to map an object without the use of annotations:
1112

1213
**Example**
1314

@@ -44,12 +45,11 @@ public class Main {
4445
u1.getEmails().add(new Email("user@gmail.com", true));
4546
u2.getEmails().add(new Email("user@gmail.com", false));
4647
47-
DiffConfiguration configuration = DiffBuilder.map(User.class)
48-
.mapper()
49-
.mappingAll()
50-
.mapper()
48+
DiffConfiguration configuration = DiffBuilder
49+
.map(User.class)
50+
.mapping("login")
51+
.mapping("password")
5152
.mapping("emails", "description")
52-
.instance()
5353
.configuration();
5454
5555
List<DiffResult> diffs = DiffObjects.diff(u1, u2, configuration);
@@ -69,9 +69,9 @@ public class Main {
6969

7070
The annotations provided by the diff objects are:
7171

72-
- DiffMapping - to map a method of the object;
73-
- DiffMappings - to map multiple properties of an object relationship;
74-
- DiffProperty - to add properties that will be on the diff result for access;
72+
- __DiffMappings:__ to map multiple properties of an object relationship;
73+
- __DiffMapping:__ to map a method of an object;
74+
- __DiffProperty:__ to add properties that will be on the diff result for access;
7575

7676
**Example**
7777

@@ -180,6 +180,5 @@ public class Main {
180180

181181
## Future implementations
182182

183-
- Order of the result using @DiffOrder not implemented yet;
184183
- Enable only different object for diff result;
185-
- Collection with value working with navigate properties like "emails.principal.description";
184+
- Collection with value working with nested fields (Ex: "emails.principal.description");

0 commit comments

Comments
 (0)