public class NormalizePropertiesBuilderImpl extends Object implements NormalizePropertiesBuilder
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
Constructor and Description |
---|
NormalizePropertiesBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
String[] |
getText()
Retrieves the text from the text property.
|
static boolean |
isAmbiguousProperty(String aTextA,
String aTextB)
Tests whether two texts are equal when flattened (e.g. no Camel case nor
Pascal case any more and no more "_" underscores")
|
void |
setText(String... aText)
Sets the text for the text property.
|
protected static String |
toNormalizedProperty(String aPropertyKey)
Converts a Pascal case or camel case property to an "_" underscore
separated upper case property.
|
static List<org.refcodes.structure.Relation<String,String>> |
toProperties(String aSeparatedValuesProperties,
char aDelimiter)
Similar to
SeparatedValuesUtility#fromSeparatedValues(String, char) with the
difference, that additionally properties with key and value are extracted
from the separated values. |
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...) |
B |
withText(Collection<String> aText)
Sets the text for the text property.
|
B |
withText(String... aText)
Sets the text for the text property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getText
setText, setText
withText
toString
public String[] toStrings()
TextAccessor.TextProvider
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
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<NormalizePropertiesBuilder>
aText
- The text to be processed.String
arraypublic static List<org.refcodes.structure.Relation<String,String>> toProperties(String aSeparatedValuesProperties, char aDelimiter) throws ParseException
SeparatedValuesUtility#fromSeparatedValues(String, char)
with the
difference, that additionally properties with key and value are extracted
from the separated values. This is useful when parsing portions of URLs.aSeparatedValuesProperties
- The String
containing separated
values with properties.aDelimiter
- The delimiter used for separating the elements if the
single CSV String
.List
with property elements.ParseException
- in case there were problems identifying the
properties.public static boolean isAmbiguousProperty(String aTextA, String aTextB)
aTextA
- The first test to be compared with the second text.aTextB
- The second text to be compared with the first text.protected static String toNormalizedProperty(String aPropertyKey)
aPropertyKey
- The property key to be converted.public 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)
TextAccessor.TextBuilder
public B withText(Collection<String> aText)
TextAccessor.TextBuilder
withText
in interface TextAccessor.TextBuilder<Text<B extends Text<B>>>
aText
- The text to be stored by the text property.public String toString()
String
being build by the builder upon the settings of the
attributes. The string array is returned as a single String
with
the operating system's end of line marker (CR on on Windows and CR LF on
*nix operating systems) as determined by
SystemUtility.getLineBreak()
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.