diff options
author | Caleb Brinkman <cbrinkman@sonatype.com> | 2019-09-11 09:17:02 -0500 |
---|---|---|
committer | Caleb Brinkman <cbrinkman@sonatype.com> | 2019-09-11 09:17:02 -0500 |
commit | dc56309dada0ae0fba2c939d3fc300d6abac145c (patch) | |
tree | f79b31cb086a368aa467f359b84923bca1ecaa6b /website/usageExamples | |
parent | 4dc5c32d6b47264b5c8abb6fdf24077eec5aa7e7 (diff) | |
parent | 8c32769f18361ed626ebd06962d924c288950d26 (diff) | |
download | lombok-dc56309dada0ae0fba2c939d3fc300d6abac145c.tar.gz lombok-dc56309dada0ae0fba2c939d3fc300d6abac145c.tar.bz2 lombok-dc56309dada0ae0fba2c939d3fc300d6abac145c.zip |
Merge branch 'master' of github.com:rzwitserloot/lombok into feature/builder-setter-prefixes
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; - } -} |