mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-25 21:58:35 +00:00
21 lines
292 B
Plaintext
21 lines
292 B
Plaintext
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");
|
|
}
|
|
}
|