diff options
Diffstat (limited to 'website/usageExamples/WithExample_pre.jpage')
-rw-r--r-- | website/usageExamples/WithExample_pre.jpage | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/website/usageExamples/WithExample_pre.jpage b/website/usageExamples/WithExample_pre.jpage new file mode 100644 index 00000000..3c76204e --- /dev/null +++ b/website/usageExamples/WithExample_pre.jpage @@ -0,0 +1,14 @@ +import lombok.AccessLevel; +import lombok.NonNull; +import lombok.With; + +public class WithExample { + @With private final int age; + @With(AccessLevel.PROTECTED) @NonNull private final String name; + + public WithExample(String name, int age) { + if (name == null) throw new NullPointerException(); + this.name = name; + this.age = age; + } +} |