|
| 1 | +import java.util.List; |
| 2 | + |
| 3 | +public abstract class SuperBuilderJavadoc { |
| 4 | + /** |
| 5 | + * basic gets only a builder setter. |
| 6 | + * @see #getsetwith |
| 7 | + * @return tag is removed from the setter. |
| 8 | + */ |
| 9 | + private final int basic; |
| 10 | + /** |
| 11 | + * getsetwith gets a builder setter, an instance getter and setter, and a wither. |
| 12 | + */ |
| 13 | + private int getsetwith; |
| 14 | + /** |
| 15 | + * Predef has a predefined builder setter with no javadoc, and the builder setter does not get this one. |
| 16 | + * @param tag remains on the field. |
| 17 | + * @return tag remains on the field. |
| 18 | + */ |
| 19 | + private final int predef; |
| 20 | + /** |
| 21 | + * predefWithJavadoc has a predefined builder setter with javadoc, so it keeps that one untouched. |
| 22 | + * @param tag is removed from the field. |
| 23 | + * @return tag remains on the field. |
| 24 | + */ |
| 25 | + private final int predefWithJavadoc; |
| 26 | + |
| 27 | + |
| 28 | + public static abstract class SuperBuilderJavadocBuilder<C extends SuperBuilderJavadoc, B extends SuperBuilderJavadocBuilder<C, B>> { |
| 29 | + @java.lang.SuppressWarnings("all") |
| 30 | + private int basic; |
| 31 | + @java.lang.SuppressWarnings("all") |
| 32 | + private int getsetwith; |
| 33 | + @java.lang.SuppressWarnings("all") |
| 34 | + private int predef; |
| 35 | + @java.lang.SuppressWarnings("all") |
| 36 | + private int predefWithJavadoc; |
| 37 | + |
| 38 | + public B predef(final int x) { |
| 39 | + this.predef = x * 10; |
| 40 | + return self(); |
| 41 | + } |
| 42 | + |
| 43 | + /** |
| 44 | + * This javadoc remains untouched. |
| 45 | + * @param x 1/100 of the thing |
| 46 | + * @return the updated builder |
| 47 | + */ |
| 48 | + public B predefWithJavadoc(final int x) { |
| 49 | + this.predefWithJavadoc = x * 100; |
| 50 | + return self(); |
| 51 | + } |
| 52 | + |
| 53 | + /** |
| 54 | + * basic gets only a builder setter. |
| 55 | + * @see #getsetwith |
| 56 | + * @param tag is moved to the setter. |
| 57 | + * @return {@code this}. |
| 58 | + */ |
| 59 | + @java.lang.SuppressWarnings("all") |
| 60 | + public B basic(final int basic) { |
| 61 | + this.basic = basic; |
| 62 | + return self(); |
| 63 | + } |
| 64 | + |
| 65 | + /** |
| 66 | + * getsetwith gets a builder setter, an instance getter and setter, and a wither. |
| 67 | + * @param tag is moved to the setters and wither. |
| 68 | + * @return {@code this}. |
| 69 | + */ |
| 70 | + @java.lang.SuppressWarnings("all") |
| 71 | + public B getsetwith(final int getsetwith) { |
| 72 | + this.getsetwith = getsetwith; |
| 73 | + return self(); |
| 74 | + } |
| 75 | + |
| 76 | + @java.lang.SuppressWarnings("all") |
| 77 | + protected abstract B self(); |
| 78 | + |
| 79 | + @java.lang.SuppressWarnings("all") |
| 80 | + public abstract C build(); |
| 81 | + |
| 82 | + @java.lang.Override |
| 83 | + @java.lang.SuppressWarnings("all") |
| 84 | + public java.lang.String toString() { |
| 85 | + return "SuperBuilderJavadoc.SuperBuilderJavadocBuilder(basic=" + this.basic + ", getsetwith=" + this.getsetwith + ", predef=" + this.predef + ", predefWithJavadoc=" + this.predefWithJavadoc + ")"; |
| 86 | + } |
| 87 | + } |
| 88 | + |
| 89 | + @java.lang.SuppressWarnings("all") |
| 90 | + protected SuperBuilderJavadoc(final SuperBuilderJavadoc.SuperBuilderJavadocBuilder<?, ?> b) { |
| 91 | + this.basic = b.basic; |
| 92 | + this.getsetwith = b.getsetwith; |
| 93 | + this.predef = b.predef; |
| 94 | + this.predefWithJavadoc = b.predefWithJavadoc; |
| 95 | + } |
| 96 | + |
| 97 | + /** |
| 98 | + * getsetwith gets a builder setter, an instance getter and setter, and a wither. |
| 99 | + * @return tag is moved to the getter. |
| 100 | + */ |
| 101 | + @java.lang.SuppressWarnings("all") |
| 102 | + public int getGetsetwith() { |
| 103 | + return this.getsetwith; |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * getsetwith gets a builder setter, an instance getter and setter, and a wither. |
| 108 | + * @param tag is moved to the setters and wither. |
| 109 | + */ |
| 110 | + @java.lang.SuppressWarnings("all") |
| 111 | + public void setGetsetwith(final int getsetwith) { |
| 112 | + this.getsetwith = getsetwith; |
| 113 | + } |
| 114 | + |
| 115 | + /** |
| 116 | + * getsetwith gets a builder setter, an instance getter and setter, and a wither. |
| 117 | + * @param tag is moved to the setters and wither. |
| 118 | + * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed). |
| 119 | + */ |
| 120 | + @java.lang.SuppressWarnings("all") |
| 121 | + public abstract SuperBuilderJavadoc withGetsetwith(final int getsetwith); |
| 122 | +} |
0 commit comments