diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-08-26 22:46:34 +0200 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-08-27 00:15:47 +0200 |
commit | da5d9a12e72dc19888b9c1f69b34e73b2b25590c (patch) | |
tree | e2939b4efb28483c2ffef599e867b220e0ca1b7f /website/usageExamples | |
parent | 461b5541da3fc8c43439f032e2f1d37574a1a658 (diff) | |
download | lombok-da5d9a12e72dc19888b9c1f69b34e73b2b25590c.tar.gz lombok-da5d9a12e72dc19888b9c1f69b34e73b2b25590c.tar.bz2 lombok-da5d9a12e72dc19888b9c1f69b34e73b2b25590c.zip |
[With] updated documentation for Wither/With
Diffstat (limited to 'website/usageExamples')
-rw-r--r-- | website/usageExamples/WithExample_post.jpage | 21 | ||||
-rw-r--r-- | website/usageExamples/WithExample_pre.jpage | 14 | ||||
-rw-r--r-- | website/usageExamples/experimental/WitherExample_post.jpage | 21 | ||||
-rw-r--r-- | website/usageExamples/experimental/WitherExample_pre.jpage | 14 |
4 files changed, 35 insertions, 35 deletions
diff --git a/website/usageExamples/WithExample_post.jpage b/website/usageExamples/WithExample_post.jpage new file mode 100644 index 00000000..a881ed8d --- /dev/null +++ b/website/usageExamples/WithExample_post.jpage @@ -0,0 +1,21 @@ +import lombok.NonNull; + +public class WithExample { + private final int age; + private @NonNull final String name; + + public WithExample(String name, int age) { + if (name == null) throw new NullPointerException(); + this.name = name; + this.age = age; + } + + public WithExample withAge(int age) { + return this.age == age ? this : new WithExample(name, age); + } + + protected WithExample withName(@NonNull String name) { + if (name == null) throw new java.lang.NullPointerException("name"); + return this.name == name ? this : new WithExample(name, age); + } +} 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; + } +} diff --git a/website/usageExamples/experimental/WitherExample_post.jpage b/website/usageExamples/experimental/WitherExample_post.jpage deleted file mode 100644 index 3447192a..00000000 --- a/website/usageExamples/experimental/WitherExample_post.jpage +++ /dev/null @@ -1,21 +0,0 @@ -import lombok.NonNull; - -public class WitherExample { - private final int age; - private @NonNull final String name; - - public WitherExample(String name, int age) { - if (name == null) throw new NullPointerException(); - this.name = name; - this.age = age; - } - - public WitherExample withAge(int age) { - return this.age == age ? this : new WitherExample(name, age); - } - - protected WitherExample withName(@NonNull String name) { - if (name == null) throw new java.lang.NullPointerException("name"); - return this.name == name ? this : new WitherExample(name, age); - } -}
\ No newline at end of file diff --git a/website/usageExamples/experimental/WitherExample_pre.jpage b/website/usageExamples/experimental/WitherExample_pre.jpage deleted file mode 100644 index 5db799fc..00000000 --- a/website/usageExamples/experimental/WitherExample_pre.jpage +++ /dev/null @@ -1,14 +0,0 @@ -import lombok.AccessLevel; -import lombok.NonNull; -import lombok.experimental.Wither; - -public class WitherExample { - @Wither private final int age; - @Wither(AccessLevel.PROTECTED) @NonNull private final String name; - - public WitherExample(String name, int age) { - if (name == null) throw new NullPointerException(); - this.name = name; - this.age = age; - } -} |