Class LocalizedStringsBuilder

  • All Implemented Interfaces:

    
    public class LocalizedStringsBuilder
    
                        

    Convenient class to build localized string lists.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • LocalizedStringsBuilder

        LocalizedStringsBuilder()
        Creates an instance with empty localized string list.
      • LocalizedStringsBuilder

        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

        LocalizedStringsBuilder(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.
        text - the text of the first element in the localized string list.
    • Method Detail

      • add

         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

         LocalizedStringsBuilder add(@Nullable() String lang, String text)

        Adds a text with specified language.

        Parameters:
        lang - locale identifier in accordance to XML xml:lang specification.
        text - the text to add.
        Returns:

        the object where the text was added to chain multiple calls.

      • get

         List<LocalizedStringType> get()

        Gets the actual localized texts.

        Returns:

        copy of the current localized string list.