aboutsummaryrefslogtreecommitdiff
path: root/usage_examples/NonNullExample_post.jpage
diff options
context:
space:
mode:
Diffstat (limited to 'usage_examples/NonNullExample_post.jpage')
-rw-r--r--usage_examples/NonNullExample_post.jpage13
1 files changed, 13 insertions, 0 deletions
diff --git a/usage_examples/NonNullExample_post.jpage b/usage_examples/NonNullExample_post.jpage
new file mode 100644
index 00000000..24175e06
--- /dev/null
+++ b/usage_examples/NonNullExample_post.jpage
@@ -0,0 +1,13 @@
+import lombok.NonNull;
+
+public class NonNullExample extends Something {
+ private String name;
+
+ public NonNullExample(@NonNull Person person) {
+ super("Hello");
+ if (person == null) {
+ throw new NullPointerException("person");
+ }
+ this.name = person.getName();
+ }
+}