@@ -27,7 +27,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
2727 */
2828public final class TextStyle {
2929
30- /**
30+ /**
3131 * The alignment possibilities.
3232 */
3333 public enum Alignment {
@@ -91,28 +91,6 @@ public static final class Builder implements Supplier<TextStyle> {
9191 private Builder () {
9292 }
9393
94- /**
95- * Constructs a builder from an existing TextStyle. The default values are:
96- * <ul>
97- * <li>alignment = LEFT</li>
98- * <li>leftPad = 0</li>
99- * <li>scaling = VARIABLE</li>
100- * <li>minWidth = 0</li>
101- * <li>maxWidth = UNSET_MAX_WIDTH</li>
102- * </ul>
103- * *
104- *
105- * @param style the TextStyle to set all values from.
106- */
107- private Builder (final TextStyle style ) {
108- this .alignment = style .alignment ;
109- this .leftPad = style .leftPad ;
110- this .indent = style .indent ;
111- this .scalable = style .scalable ;
112- this .minWidth = style .minWidth ;
113- this .maxWidth = style .maxWidth ;
114- }
115-
11694 @ Override
11795 public TextStyle get () {
11896 return new TextStyle (this );
@@ -228,6 +206,23 @@ public Builder setScalable(final boolean scalable) {
228206 this .scalable = scalable ;
229207 return this ;
230208 }
209+
210+ /**
211+ * Sets all properties from the given text style.
212+ *
213+ * @param style the source text style.
214+ * @return this instance.
215+ */
216+ public Builder setTextStyle (final TextStyle style ) {
217+ this .alignment = style .alignment ;
218+ this .leftPad = style .leftPad ;
219+ this .indent = style .indent ;
220+ this .scalable = style .scalable ;
221+ this .minWidth = style .minWidth ;
222+ this .maxWidth = style .maxWidth ;
223+ return this ;
224+ }
225+
231226 }
232227
233228 /**
@@ -249,16 +244,6 @@ public static Builder builder() {
249244 return new Builder ();
250245 }
251246
252- /**
253- * Creates a new builder.
254- *
255- * @param textStyle The new builder values are copied from the given TextStyle.
256- * @return a new builder.
257- */
258- public static Builder builder (final TextStyle textStyle ) {
259- return new Builder (textStyle );
260- }
261-
262247 /** The alignment. */
263248 private final Alignment alignment ;
264249
0 commit comments