org.refcodes.mixin.ColumnWidthAccessor
, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<MoreTextBuilder>
, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
, Text<MoreTextBuilder>
, TextAccessor
, TextAccessor.TextBuilder<MoreTextBuilder>
, TextAccessor.TextMutator
, TextAccessor.TextProperty
, TextAccessor.TextProvider
public class MoreTextBuilder extends Object implements Text<MoreTextBuilder>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<MoreTextBuilder>
MoreTextMode
applied.org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B extends org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B>>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
Constructor | Description |
---|---|
MoreTextBuilder() |
Modifier and Type | Method | Description |
---|---|---|
static String[] |
asMoreText(String[] aText,
int aLength,
String aMore,
MoreTextMode aMoreTextMode) |
The text array is "mored" depending on the provided
MoreTextMode . |
static String[] |
asMoreText(String[] aText,
int aLength,
String aMore,
MoreTextMode aMoreTextMode,
boolean hasAnsiEscapeCodes) |
The text array is "mored" depending on the provided
MoreTextMode . |
static String |
asMoreText(String aText,
int aLength,
String aMore,
MoreTextMode aMoreTextMode) |
The text is "mored" depending on the provided
MoreTextMode . |
static String |
asMoreText(String aText,
int aLength,
String aMore,
MoreTextMode aMoreTextMode,
boolean hasAnsiEscapeCodes) |
The text is "mored" depending on the provided
MoreTextMode . |
int |
getColumnWidth() |
|
String |
getMoreText() |
Retrieves the more text from the more text property.
|
MoreTextMode |
getMoreTextMode() |
Retrieves the more text mode from the more text mode property.
|
String[] |
getText() |
Retrieves the text from the text property.
|
void |
setColumnWidth(int aColumnWidth) |
|
void |
setMoreText(String aMoreText) |
Sets the more text for the more text property.
|
void |
setMoreTextMode(MoreTextMode aMoreTextMode) |
Sets the more text mode for the more text mode property.
|
void |
setText(String... aText) |
Sets the text for the text property.
|
String |
toString(String... aText) |
Race condition safe shortcut for using
Text.withText(String...)
followed by TextAccessor.TextProvider.toString() . |
String |
toString() |
The
String being build by the builder upon the settings of the
attributes. |
String[] |
toStrings() |
The
String s being build by the builder upon the settings of the
attributes. |
String[] |
toStrings(String... aText) |
Race condition safe shortcut for using
Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings() . |
MoreTextBuilder |
withColumnWidth(int aColumnWidth) |
|
MoreTextBuilder |
withMoreText(String aMoreText) |
Sets the more text for the more text property.
|
MoreTextBuilder |
withMoreTextMode(MoreTextMode aMoreTextMode) |
Sets the more text mode for the more text mode property.
|
B |
withText(String... aText) |
With text.
|
B |
withText(Collection<String> aText) |
With text.
|
letColumnWidth
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getText
withText
setText, setText
letText, letText
public String getMoreText()
public void setMoreText(String aMoreText)
aMoreText
- The more text to be stored by the more text mode
property.public int getColumnWidth()
getColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor
public void setColumnWidth(int aColumnWidth)
setColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
public MoreTextBuilder withColumnWidth(int aColumnWidth)
withColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<MoreTextBuilder>
public MoreTextMode getMoreTextMode()
public void setMoreTextMode(MoreTextMode aMoreTextMode)
aMoreTextMode
- The more text mode to be stored by the more text
mode property.public String[] toStrings()
String
s being build by the builder upon the settings of the
attributes.toStrings
in interface TextAccessor.TextProvider
String
arraypublic String[] toStrings(String... aText)
Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings()
. Implementation requirements: This
method must not(!) be implemented by calling Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings()
(do not change the text property) as
this would not be thread safe!toStrings
in interface Text<MoreTextBuilder>
aText
- The text to be processed.String
arraypublic MoreTextBuilder withMoreTextMode(MoreTextMode aMoreTextMode)
aMoreTextMode
- the more text modepublic MoreTextBuilder withMoreText(String aMoreText)
aMoreText
- the more textpublic String toString() throws IllegalStateException
String
being build by the builder upon the settings of the
attributes.toString
in interface TextAccessor.TextProvider
String
IllegalStateException
- Thrown in case more than one text line has
been set via the withText(String...)
or
setText(String...)
methods.public static String[] asMoreText(String[] aText, int aLength, String aMore, MoreTextMode aMoreTextMode)
MoreTextMode
.
It is assumed that the text does not contain any ANSI escape codes, else
asMoreText(String[], int, String, MoreTextMode, boolean)
In case
it is MoreTextMode.NONE
, then the text is returned untouched. In
case it is MoreTextMode.LEFT
, then the text is "mored" to the
left. In case it is MoreTextMode.RIGHT
, then the text is "mored"
the the right.aText
- The text array to be truncated.aLength
- The length to be reached.aMore
- The text to be prepended to the left in case the text was
longer than the required length.aMoreTextMode
- The MoreTextMode
specifying on how to
truncate the text.public static String[] asMoreText(String[] aText, int aLength, String aMore, MoreTextMode aMoreTextMode, boolean hasAnsiEscapeCodes)
MoreTextMode
.
In case it is MoreTextMode.NONE
, then the text is returned
untouched. In case it is MoreTextMode.LEFT
, then the text is
"mored" to the left. In case it is MoreTextMode.RIGHT
, then the
text is "mored" the the right.aText
- The text array to be truncated.aLength
- The length to be reached.aMore
- The text to be prepended to the left in case the text was
longer than the required length.aMoreTextMode
- The MoreTextMode
specifying on how to
truncate the text.hasAnsiEscapeCodes
- Whether to take any (non printable) ANSI escape
codes into account which would, when not being considered, cause
wrong results.public static String asMoreText(String aText, int aLength, String aMore, MoreTextMode aMoreTextMode)
MoreTextMode
. It is
assumed that the text does not contain any ANSI escape codes, else
asMoreText(String, int, String, MoreTextMode, boolean)
In case
it is MoreTextMode.NONE
, then the text is returned untouched. In
case it is MoreTextMode.LEFT
, then the text is "mored" to the
left. In case it is MoreTextMode.RIGHT
, then the text is "mored"
the the right.aText
- The text array to be truncated.aLength
- The length to be reached.aMore
- The text to be prepended to the left in case the text was
longer than the required length.aMoreTextMode
- The MoreTextMode
specifying on how to
truncate the text.public static String asMoreText(String aText, int aLength, String aMore, MoreTextMode aMoreTextMode, boolean hasAnsiEscapeCodes)
MoreTextMode
. In
case it is MoreTextMode.NONE
, then the text is returned
untouched. In case it is MoreTextMode.LEFT
, then the text is
"mored" to the left. In case it is MoreTextMode.RIGHT
, then the
text is "mored" the the right.aText
- The text to be truncated.aLength
- The length to be reached.aMore
- The text to be prepended to the left in case the text was
longer than the required length.aMoreTextMode
- The MoreTextMode
specifying on how to
truncate the text.hasAnsiEscapeCodes
- Whether to take any (non printable) ANSI escape
codes into account which would, when not being considered, cause
wrong results.public String[] getText()
getText
in interface TextAccessor
public void setText(String... aText)
setText
in interface TextAccessor.TextMutator
aText
- The text to be stored by the text property.public B withText(String... aText)
public B withText(Collection<String> aText)
withText
in interface TextAccessor.TextBuilder<B extends Text<B>>
aText
- the textpublic String toString(String... aText)
Text.withText(String...)
followed by TextAccessor.TextProvider.toString()
. Implementation requirements: This method
must not(!) be implemented by calling Text.withText(String...)
followed by TextAccessor.TextProvider.toString()
(do not change the text property) as this
would not be thread safe!Copyright © 2021. All rights reserved.