aboutsummaryrefslogtreecommitdiff
path: root/usage_examples/onXExample_pre.jpage
diff options
context:
space:
mode:
Diffstat (limited to 'usage_examples/onXExample_pre.jpage')
-rw-r--r--usage_examples/onXExample_pre.jpage17
1 files changed, 9 insertions, 8 deletions
diff --git a/usage_examples/onXExample_pre.jpage b/usage_examples/onXExample_pre.jpage
index 3e91fb3a..1bab3835 100644
--- a/usage_examples/onXExample_pre.jpage
+++ b/usage_examples/onXExample_pre.jpage
@@ -1,23 +1,24 @@
+import com.google.inject.Inject;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
+import org.hibernate.validator.Min;
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";
+ @Getter(onMethod=@Deprecated) private int bananas;
+ @Setter(onMethod=@Min(10)) private int radishes;
@Override public String toString() {
- return String.format("firestation:%s, %d firemen are fighting %d fires", fireStationName, firemen, fires);
+ return String.format("I have %d bananas and %d beautiful radishes", bananas, radishes);
}
}
-@RequiredArgsConstructor(onConstructor=@Deprecated)
+@RequiredArgsConstructor(onConstructor=@Inject)
class OnConstructorExample {
- private final int radishes;
- private int bananas;
+ private final Fireman fireman;
+ @Setter(onParam=@SuppressWarnings("all")) private int fires = 10;
@Override public String toString() {
- return String.format("I have %d bananas and %d radishes", bananas, radishes);
+ return String.format("Fireman: %s has %d fires", fireman, fires);
}
} \ No newline at end of file