forked from projectlombok/lombok
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfork changelog.txt
45 lines (38 loc) · 1.35 KB
/
fork changelog.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
1.12.5x
For fields in classes with @Data(trackChanges = true) supported following annotations:
* javax.validation.constraints.NotNull
If null constrain failed when field set, throws NullCheckException.
* javax.validation.constraints.Size (only for String fields)
If size constrain failed when field set, throws SizeCheckException.
Usage example:
-------------
@Data(trackChanges = true)
public class Person extends ChangeTracker {
@NotNull
@Size(min = 3, max = 25)
private String name;
@NotNull
private int age;
}
1.12.3x
-------
For @Data annotation added boolean option 'trackChanges',
to use this options class must be inhefited from abstract class lombok.ChangeTracker.
This option allow to recognize is setter was caller for particular field, after object created.
Example:
-------
@Data(trackChanges = true)
public class Person extends ChangeTracker {
private String name;
private int age;
}
...
Person person = new Person();
person.setName("Smith");
System.out.println("Is name changed: " + person.isChanged("name")); // Is name changed: true
System.out.println("Is age changed: " + person.isChanged("age")); // Is age changed: false
...
One case of usage:
-----------------
After deserialization of object if field contain default value we can recognize
is default value was setted explicitly from source or not.