public class TruncateTextBuilderImpl extends Object implements TruncateTextBuilder
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
Constructor and Description |
---|
TruncateTextBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
protected static void |
doStrip(StringBuffer aStringBuffer,
char aChar)
Removes all leading and trailing chars identical with specified char ch.
|
protected static void |
doStripLeft(StringBuffer aStringBuffer,
char aChar)
Removes all leading chars identical with specified char.
|
protected static void |
doStripRight(StringBuffer aStringBuffer,
char aChar)
Removes all rear chars identical with specified char ch.
|
String[] |
getText()
Retrieves the text from the text property.
|
char[] |
getTruncateChars()
Retrieves the truncate chars from the truncate chars property.
|
TruncateTextMode |
getTruncateTextMode()
Retrieves the truncate text mode from the truncate text mode property.
|
void |
setText(String... aText)
Sets the text for the text property.
|
void |
setTruncateChars(char... aStripChars)
Sets the truncate chars for the truncate chars property.
|
void |
setTruncateTextMode(TruncateTextMode aTruncateTextMode)
Sets the truncate text mode for the truncate text mode property.
|
String |
toString()
The
String being build by the builder upon the settings of
the attributes. |
String |
toString(String... aText)
Race condition safe shortcut for using
Text.withText(String...) |
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...) |
protected static String |
toStrip(String aText,
char[] aChars)
Returns a new String without leading nor trailing chars.
|
protected static String |
toStrip(String aText,
char[] aChars,
TruncateTextMode aTruncateTextMode)
To strip.
|
protected static String |
toStripLeft(String aText,
char[] aChars)
Returns a new String without leading chars.
|
protected static String |
toStripRight(String aText,
char[] aChars)
Returns a new String without trailing chars.
|
B |
withText(Collection<String> aText)
With text.
|
B |
withText(String... aText)
With text.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
toString, withStripChars, withText, withTruncateTextMode
getText
setText, setText
withText
public TruncateTextMode getTruncateTextMode()
TruncateTextBuilder
getTruncateTextMode
in interface TruncateTextBuilder
public void setTruncateTextMode(TruncateTextMode aTruncateTextMode)
TruncateTextBuilder
setTruncateTextMode
in interface TruncateTextBuilder
aTruncateTextMode
- The truncate text mode to be stored by the
truncate text mode property.public char[] getTruncateChars()
TruncateTextBuilder
getTruncateChars
in interface TruncateTextBuilder
public void setTruncateChars(char... aStripChars)
TruncateTextBuilder
setTruncateChars
in interface TruncateTextBuilder
aStripChars
- The truncate chars to be stored by the text align
mode property.public String[] toStrings()
TruncateTextBuilder
String
s being build by the builder upon the settings of the
attributes.toStrings
in interface TextAccessor.TextProvider
toStrings
in interface TruncateTextBuilder
String
arraypublic String[] toStrings(String... aText)
Text
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<TruncateTextBuilder>
aText
- The text to be processed.String
arrayprotected static String toStrip(String aText, char[] aChars, TruncateTextMode aTruncateTextMode)
aText
- the a textaChars
- the a charsaTruncateTextMode
- the a truncate text modeprotected static void doStripLeft(StringBuffer aStringBuffer, char aChar)
String
will be BBBAAABBB.aStringBuffer
- StringBuffer to modify.aChar
- Char to remove.protected static String toStripLeft(String aText, char[] aChars)
aText
- The text to be stripped.aChars
- the a charsprotected static void doStripRight(StringBuffer aStringBuffer, char aChar)
aStringBuffer
- StringBuffer to modify.aChar
- Char to remove.protected static void doStrip(StringBuffer aStringBuffer, char aChar)
aStringBuffer
- StringBuffer to modify.aChar
- Char to remove.protected static String toStripRight(String aText, char[] aChars)
aText
- Description is currently not available!aChars
- the a charsprotected static String toStrip(String aText, char[] aChars)
aText
- The text to be stripped.aChars
- the a charspublic String[] getText()
TextAccessor
getText
in interface TextAccessor
public void setText(String... aText)
TextAccessor.TextMutator
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<Text<B extends Text<B>>>
aText
- the a textpublic String toString()
TextAccessor.TextProvider
String
being build by the builder upon the settings of
the attributes. In case more then one line has been set as input and
the functionality of the builder is applied to each line in separate,
then this method returns all of them lines concatenated with a line
break between each of them (implementation depended).toString
in interface TextAccessor.TextProvider
toString
in class Object
String
public String toString(String... aText)
Text
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 © 2017. All rights reserved.