mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 06:17:44 +00:00
[docs] Locked example needed its usage examples moved
This commit is contained in:
2 files changed
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import lombok.Locked;
|
||||
|
||||
public class LockedExample {
|
||||
private int value = 0;
|
||||
|
||||
@Locked.Read
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Locked.Write
|
||||
public void setValue(int newValue) {
|
||||
value = newValue;
|
||||
}
|
||||
|
||||
@Locked("baseLock")
|
||||
public void foo() {
|
||||
System.out.println("bar");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user