aboutsummaryrefslogtreecommitdiff
path: root/usage_examples/onXExample_pre.jpage
blob: 3e91fb3a74a019195281715bee365e402a375c91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;

public class OnMethodOnParamExample {
	@Getter(onMethod=@Deprecated) private int fires = 200;
	@Setter(onMethod=@Deprecated) private int firemen = 20;
	@Setter(onParam=@SuppressWarnings("all")) private String fireStationName = "base";
	
	@Override public String toString() {
		return String.format("firestation:%s, %d firemen are fighting %d fires", fireStationName, firemen, fires);
	}
}

@RequiredArgsConstructor(onConstructor=@Deprecated)
class OnConstructorExample {
	private final int radishes;
	private int bananas;
	
	@Override public String toString() {
		return String.format("I have %d bananas and %d radishes", bananas, radishes);
	}
}