mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-03 05:20:17 +00:00
Issue 192: Add documentation for onMethod=, onParam, onConstructor
still have to make a minor edit in the pre/post files
This commit is contained in:
1 parent
35e18b9332
commit
e0cfacd3b3
6 files changed
+128
-1
No files matched your search
@@ -0,0 +1,41 @@
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
public class OnMethodOnParamExample {
|
||||
private int fires = 200;
|
||||
private int firemen = 20;
|
||||
private String fireStationName = "base";
|
||||
|
||||
@Deprecated
|
||||
public int getFires() {
|
||||
return fires;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setFiremen(int firemen) {
|
||||
this.firemen = firemen;
|
||||
}
|
||||
|
||||
public void setFireStationName(@SuppressWarnings("all") int fireStationName) {
|
||||
this.fireStationName = fireStationName;
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return String.format("firestation:%s, %d firemen are fighting %d fires", fireStationName, firemen, fires);
|
||||
}
|
||||
}
|
||||
|
||||
class OnConstructorExample {
|
||||
private final int radishes;
|
||||
private int bananas;
|
||||
|
||||
@Deprecated
|
||||
public OnConstructorExample(int radishes) {
|
||||
this.radishes = radishes;
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return String.format("I have %d bananas and %d radishes", bananas, radishes);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user