diff options
Diffstat (limited to 'usage_examples/experimental/WitherExample_post.jpage')
-rw-r--r-- | usage_examples/experimental/WitherExample_post.jpage | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usage_examples/experimental/WitherExample_post.jpage b/usage_examples/experimental/WitherExample_post.jpage index bb5952af..3447192a 100644 --- a/usage_examples/experimental/WitherExample_post.jpage +++ b/usage_examples/experimental/WitherExample_post.jpage @@ -3,19 +3,19 @@ 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(age, name); + 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(age, name); + return this.name == name ? this : new WitherExample(name, age); } }
\ No newline at end of file |