diff options
Diffstat (limited to 'usage_examples')
-rw-r--r-- | usage_examples/onXExample_post.jpage | 41 | ||||
-rw-r--r-- | usage_examples/onXExample_pre.jpage | 23 |
2 files changed, 64 insertions, 0 deletions
diff --git a/usage_examples/onXExample_post.jpage b/usage_examples/onXExample_post.jpage new file mode 100644 index 00000000..f71f16a3 --- /dev/null +++ b/usage_examples/onXExample_post.jpage @@ -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); + } +}
\ No newline at end of file diff --git a/usage_examples/onXExample_pre.jpage b/usage_examples/onXExample_pre.jpage new file mode 100644 index 00000000..3e91fb3a --- /dev/null +++ b/usage_examples/onXExample_pre.jpage @@ -0,0 +1,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); + } +}
\ No newline at end of file |