aboutsummaryrefslogtreecommitdiff
path: root/usage_examples/onXExample_post.jpage
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2011-05-03 02:26:15 +0200
committerRoel Spilker <r.spilker@gmail.com>2011-05-03 02:26:15 +0200
commitb93a58298556aedaeef9e3d5fa4e53bc9b0ebe59 (patch)
tree5b9aa50af1f0b8648d8083bfe9f95e4f0ac4b618 /usage_examples/onXExample_post.jpage
parente5e35213780a87c813b892d5efc1288125980baf (diff)
parent12e4f36a2f5aae5b17266fb15376c82d74b7bf95 (diff)
downloadlombok-b93a58298556aedaeef9e3d5fa4e53bc9b0ebe59.tar.gz
lombok-b93a58298556aedaeef9e3d5fa4e53bc9b0ebe59.tar.bz2
lombok-b93a58298556aedaeef9e3d5fa4e53bc9b0ebe59.zip
Merge branch 'master' of git@github.com:rzwitserloot/lombok
Diffstat (limited to 'usage_examples/onXExample_post.jpage')
-rw-r--r--usage_examples/onXExample_post.jpage42
1 files changed, 42 insertions, 0 deletions
diff --git a/usage_examples/onXExample_post.jpage b/usage_examples/onXExample_post.jpage
new file mode 100644
index 00000000..85e3c58f
--- /dev/null
+++ b/usage_examples/onXExample_post.jpage
@@ -0,0 +1,42 @@
+import com.google.inject.Inject;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.Min;
+
+public class OnMethodOnParamExample {
+ private int bananas;
+ private int radishes;
+
+ @Deprecated
+ public int getBananas() {
+ return bananas;
+ }
+
+ @Min(10)
+ public int setRadishes(int radishes) {
+ this.radishes = radishes;
+ }
+
+ @Override public String toString() {
+ return String.format("I have %d bananas and %d beautiful radishes", bananas, radishes);
+ }
+}
+
+class OnConstructorExample {
+ private final Fireman fireman;
+ private int fires = 10;
+
+ @Inject
+ public OnConstructorExample(Fireman fireman) {
+ this.fireman = fireman;
+ }
+
+ public void setFires(@SuppressWarnings("all") int fires) {
+ this.fires = fires;
+ }
+
+ @Override public String toString() {
+ return String.format("Fireman: %s has %d fires", fireman, fires);
+ }
+} \ No newline at end of file