diff options
Diffstat (limited to 'test/transform/resource/after-delombok')
6 files changed, 119 insertions, 72 deletions
diff --git a/test/transform/resource/after-delombok/BuilderWithJavaBeansSpecCapitalization.java b/test/transform/resource/after-delombok/BuilderWithJavaBeansSpecCapitalization.java new file mode 100644 index 00000000..4a21f2c3 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderWithJavaBeansSpecCapitalization.java @@ -0,0 +1,106 @@ +class BuilderWithJavaBeansSpecCapitalization { + java.util.List<String> a; + java.util.List<String> aField; + String bField; + @java.lang.SuppressWarnings("all") + BuilderWithJavaBeansSpecCapitalization(final java.util.List<String> a, final java.util.List<String> aField, final String bField) { + this.a = a; + this.aField = aField; + this.bField = bField; + } + @java.lang.SuppressWarnings("all") + public static class BuilderWithJavaBeansSpecCapitalizationBuilder { + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<String> a; + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<String> aField; + @java.lang.SuppressWarnings("all") + private String bField; + @java.lang.SuppressWarnings("all") + BuilderWithJavaBeansSpecCapitalizationBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder setZ(final String z) { + if (this.a == null) this.a = new java.util.ArrayList<String>(); + this.a.add(z); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder setA(final java.util.Collection<? extends String> a) { + if (a == null) { + throw new java.lang.NullPointerException("a cannot be null"); + } + if (this.a == null) this.a = new java.util.ArrayList<String>(); + this.a.addAll(a); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder clearA() { + if (this.a != null) this.a.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder setyField(final String yField) { + if (this.aField == null) this.aField = new java.util.ArrayList<String>(); + this.aField.add(yField); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder setaField(final java.util.Collection<? extends String> aField) { + if (aField == null) { + throw new java.lang.NullPointerException("aField cannot be null"); + } + if (this.aField == null) this.aField = new java.util.ArrayList<String>(); + this.aField.addAll(aField); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder clearaField() { + if (this.aField != null) this.aField.clear(); + return this; + } + /** + * @return {@code this}. + */ + @java.lang.SuppressWarnings("all") + public BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder setbField(final String bField) { + this.bField = bField; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderWithJavaBeansSpecCapitalization build() { + java.util.List<String> a; + switch (this.a == null ? 0 : this.a.size()) { + case 0: + a = java.util.Collections.emptyList(); + break; + case 1: + a = java.util.Collections.singletonList(this.a.get(0)); + break; + default: + a = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.a)); + } + java.util.List<String> aField; + switch (this.aField == null ? 0 : this.aField.size()) { + case 0: + aField = java.util.Collections.emptyList(); + break; + case 1: + aField = java.util.Collections.singletonList(this.aField.get(0)); + break; + default: + aField = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.aField)); + } + return new BuilderWithJavaBeansSpecCapitalization(a, aField, this.bField); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder(a=" + this.a + ", aField=" + this.aField + ", bField=" + this.bField + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder builder() { + return new BuilderWithJavaBeansSpecCapitalization.BuilderWithJavaBeansSpecCapitalizationBuilder(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/GetterWithJavaBeansSpecCapitalization.java b/test/transform/resource/after-delombok/GetterWithJavaBeansSpecCapitalization.java index 06026c1b..51ccfe63 100644 --- a/test/transform/resource/after-delombok/GetterWithJavaBeansSpecCapitalization.java +++ b/test/transform/resource/after-delombok/GetterWithJavaBeansSpecCapitalization.java @@ -1,17 +1,3 @@ -class GetterWithoutJavaBeansSpecCapitalization { - int a; - int aField; - @java.lang.SuppressWarnings("all") - public int getA() { - return this.a; - } - @java.lang.SuppressWarnings("all") - public int getAField() { - return this.aField; - } -} - - class GetterWithJavaBeansSpecCapitalization { int a; int aField; @@ -23,6 +9,4 @@ class GetterWithJavaBeansSpecCapitalization { public int getaField() { return this.aField; } -} - - +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/SetterWithJavaBeansSpecCapitalization.java b/test/transform/resource/after-delombok/SetterWithJavaBeansSpecCapitalization.java index 24c8e883..de68ee60 100644 --- a/test/transform/resource/after-delombok/SetterWithJavaBeansSpecCapitalization.java +++ b/test/transform/resource/after-delombok/SetterWithJavaBeansSpecCapitalization.java @@ -1,16 +1,3 @@ -class SetterWithoutJavaBeansSpecCapitalization { - int a; - int aField; - @java.lang.SuppressWarnings("all") - public void setA(final int a) { - this.a = a; - } - @java.lang.SuppressWarnings("all") - public void setAField(final int aField) { - this.aField = aField; - } -} - class SetterWithJavaBeansSpecCapitalization { int a; int aField; @@ -23,5 +10,3 @@ class SetterWithJavaBeansSpecCapitalization { this.aField = aField; } } - - diff --git a/test/transform/resource/after-delombok/ValueWithJavaBeansSpecCapitalization.java b/test/transform/resource/after-delombok/ValueWithJavaBeansSpecCapitalization.java index 20139baf..b92dd5b6 100644 --- a/test/transform/resource/after-delombok/ValueWithJavaBeansSpecCapitalization.java +++ b/test/transform/resource/after-delombok/ValueWithJavaBeansSpecCapitalization.java @@ -1,16 +1,13 @@ final class ValueWithJavaBeansSpecCapitalization { private final int aField; - @java.lang.SuppressWarnings("all") public ValueWithJavaBeansSpecCapitalization(final int aField) { this.aField = aField; } - @java.lang.SuppressWarnings("all") public int getaField() { return this.aField; } - @java.lang.Override @java.lang.SuppressWarnings("all") public boolean equals(final java.lang.Object o) { @@ -20,7 +17,6 @@ final class ValueWithJavaBeansSpecCapitalization { if (this.getaField() != other.getaField()) return false; return true; } - @java.lang.Override @java.lang.SuppressWarnings("all") public int hashCode() { @@ -29,27 +25,22 @@ final class ValueWithJavaBeansSpecCapitalization { result = result * PRIME + this.getaField(); return result; } - @java.lang.Override @java.lang.SuppressWarnings("all") public java.lang.String toString() { return "ValueWithJavaBeansSpecCapitalization(aField=" + this.getaField() + ")"; } } - final class ValueWithoutJavaBeansSpecCapitalization { private final int aField; - @java.lang.SuppressWarnings("all") public ValueWithoutJavaBeansSpecCapitalization(final int aField) { this.aField = aField; } - @java.lang.SuppressWarnings("all") public int getAField() { return this.aField; } - @java.lang.Override @java.lang.SuppressWarnings("all") public boolean equals(final java.lang.Object o) { @@ -59,7 +50,6 @@ final class ValueWithoutJavaBeansSpecCapitalization { if (this.getAField() != other.getAField()) return false; return true; } - @java.lang.Override @java.lang.SuppressWarnings("all") public int hashCode() { @@ -68,7 +58,6 @@ final class ValueWithoutJavaBeansSpecCapitalization { result = result * PRIME + this.getAField(); return result; } - @java.lang.Override @java.lang.SuppressWarnings("all") public java.lang.String toString() { diff --git a/test/transform/resource/after-delombok/WithOnJavaBeansSpecCapitalization.java b/test/transform/resource/after-delombok/WithOnJavaBeansSpecCapitalization.java deleted file mode 100644 index afed2f0e..00000000 --- a/test/transform/resource/after-delombok/WithOnJavaBeansSpecCapitalization.java +++ /dev/null @@ -1,29 +0,0 @@ -class WithOnJavaBeansSpecCapitalization { - int aField; - - WithOnJavaBeansSpecCapitalization(int aField) { - } - - /** - * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed). - */ - @java.lang.SuppressWarnings("all") - public WithOnJavaBeansSpecCapitalization withaField(final int aField) { - return this.aField == aField ? this : new WithOnJavaBeansSpecCapitalization(aField); - } -} - -class WithOffJavaBeansSpecCapitalization { - int aField; - - WithOffJavaBeansSpecCapitalization(int aField) { - } - - /** - * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed). - */ - @java.lang.SuppressWarnings("all") - public WithOffJavaBeansSpecCapitalization withAField(final int aField) { - return this.aField == aField ? this : new WithOffJavaBeansSpecCapitalization(aField); - } -} diff --git a/test/transform/resource/after-delombok/WithWithJavaBeansSpecCapitalization.java b/test/transform/resource/after-delombok/WithWithJavaBeansSpecCapitalization.java new file mode 100644 index 00000000..e3737848 --- /dev/null +++ b/test/transform/resource/after-delombok/WithWithJavaBeansSpecCapitalization.java @@ -0,0 +1,12 @@ +class WithWithJavaBeansSpecCapitalization { + int aField; + WithWithJavaBeansSpecCapitalization(int aField) { + } + /** + * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed). + */ + @java.lang.SuppressWarnings("all") + public WithWithJavaBeansSpecCapitalization withaField(final int aField) { + return this.aField == aField ? this : new WithWithJavaBeansSpecCapitalization(aField); + } +} |