Text<ReplaceTextBuilder>
, TextAccessor
, TextAccessor.TextBuilder<ReplaceTextBuilder>
, TextAccessor.TextMutator
, TextAccessor.TextProperty
, TextAccessor.TextProvider
public class ReplaceTextBuilder extends Object implements Text<ReplaceTextBuilder>
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
Constructor | Description |
---|---|
ReplaceTextBuilder() |
Modifier and Type | Method | Description |
---|---|---|
static String[] |
asReplaced(String[] aText,
String aFindText,
String aReplaceText) |
Replaces a text by an other text in a
String array. |
static int |
asReplaced(StringBuffer aTextBuffer,
String aFindText,
String aReplaceText) |
Replaces a text by an other text in a StringBuffer.
|
static String |
asReplaced(String aText,
String aFindText,
String aReplaceText) |
|
String |
getFindText() |
Retrieves the find text from the find text property.
|
String |
getReplaceText() |
Retrieves the replace text from the replace text property.
|
String[] |
getText() |
Retrieves the text from the text property.
|
void |
setFindText(String aFindText) |
Sets the find text for the find text property.
|
void |
setReplaceText(String aReplaceText) |
Sets the replace text for the replace text property.
|
void |
setText(String... aText) |
Sets the text for the text 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...)
followed by TextAccessor.TextProvider.toString() . |
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() . |
ReplaceTextBuilder |
withFindText(String aFindText) |
Sets the find text for the find text property.
|
ReplaceTextBuilder |
withReplaceText(String aReplaceText) |
Sets the replace text for the replace text property.
|
B |
withText(String... aText) |
With text.
|
B |
withText(Collection<String> aText) |
With text.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getText
withText
setText, setText
letText, letText
toString
public String getReplaceText()
public void setReplaceText(String aReplaceText)
aReplaceText
- The replace text to be stored by the text align mode
property.public String getFindText()
public void setFindText(String aFindText)
aFindText
- The find text to be stored by the text align mode
property.public String[] toStrings() throws IllegalStateException
String
s being build by the builder upon the settings of
the attributes.toStrings
in interface TextAccessor.TextProvider
String
arrayIllegalStateException
public 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<ReplaceTextBuilder>
aText
- The text to be processed.String
arraypublic ReplaceTextBuilder withReplaceText(String aReplaceText)
aReplaceText
- The replace text to be stored by the text align mode
property.public ReplaceTextBuilder withFindText(String aFindText)
aFindText
- The find text to be stored by the text align mode
property.public static String[] asReplaced(String[] aText, String aFindText, String aReplaceText)
String
array.aText
- The text to be processed ('find-and-replace').aFindText
- The text which has to be replaced.aReplaceText
- The text that replaces the original.public static int asReplaced(StringBuffer aTextBuffer, String aFindText, String aReplaceText)
aTextBuffer
- The text to be processed ('find-and-replace').aFindText
- The text which has to be replaced.aReplaceText
- The text that replaces the original.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
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.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.