Package org.somda.sdc.dpws
Class LocalizedStringsBuilder
- java.lang.Object
-
- org.somda.sdc.dpws.LocalizedStringsBuilder
-
public class LocalizedStringsBuilder extends Object
Convenient class to build localized string lists.
-
-
Constructor Summary
Constructors Constructor Description LocalizedStringsBuilder()Creates an instance with empty localized string list.LocalizedStringsBuilder(String text)Creates an instance with one text in default language.LocalizedStringsBuilder(String locale, String text)Creates an instance with one text in a specified language.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalizedStringsBuilderadd(String text)Adds a text in default language.LocalizedStringsBuilderadd(String lang, String text)Adds a text with specified language.LocalizedStringsBuilderclear()Resets current localized string buffer.List<LocalizedStringType>get()Gets the actual localized texts.
-
-
-
Constructor Detail
-
LocalizedStringsBuilder
public LocalizedStringsBuilder()
Creates an instance with empty localized string list.
-
LocalizedStringsBuilder
public LocalizedStringsBuilder(String text)
Creates an instance with one text in default language.- Parameters:
text- the text of the first element in the localized string list.
-
LocalizedStringsBuilder
public LocalizedStringsBuilder(@Nullable String locale, String text)Creates an instance with one text in a specified language.- Parameters:
locale- the locale identifier in accordance to XML xml:lang specification. Default is used if null.text- the text of the first element in the localized string list.
-
-
Method Detail
-
add
public LocalizedStringsBuilder add(String text)
Adds a text in default language.- Parameters:
text- the text to add.- Returns:
- the object where the text was added to chain multiple calls.
-
add
public LocalizedStringsBuilder add(@Nullable String lang, String text)
Adds a text with specified language.- Parameters:
lang- locale identifier in accordance to XML xml:lang specification. Default is used if null.text- the text to add.- Returns:
- the object where the text was added to chain multiple calls.
-
get
public List<LocalizedStringType> get()
Gets the actual localized texts.- Returns:
- copy of the current localized string list.
-
clear
public LocalizedStringsBuilder clear()
Resets current localized string buffer.- Returns:
- this instance with reset localized string buffer.
-
-