Class I18nString.Builder

  • Enclosing class:
    I18nString

    public static final class I18nString.Builder
    extends java.lang.Object
    Allows creating a I18nString in a handier way.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      I18nString.Builder anyLanguage​(java.lang.String value)
      Add string to use as a default value, when there is no translation to some language
      I18nString build()  
      I18nString.Builder put​(java.lang.String languageCode, java.lang.String value)
      Add string translated into another language.
      I18nString.Builder put​(java.util.Locale locale, java.lang.String value)
      Add string translated into another language.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Builder

        public Builder()
      • Builder

        public Builder​(@NonNull
                       java.lang.String defaultValue)
      • Builder

        public Builder​(@NonNull
                       I18nString toCopy)
    • Method Detail

      • put

        public I18nString.Builder put​(@NonNull
                                      java.lang.String languageCode,
                                      @NonNull
                                      java.lang.String value)
        Add string translated into another language.
        Parameters:
        languageCode - language name in ISO 639-2 format. If is null, this method does nothing.
        value - translated into provided language. If is null, this method does nothing.
        Returns:
        current I18nString.Builder instance
      • put

        public I18nString.Builder put​(@NonNull
                                      java.util.Locale locale,
                                      @NonNull
                                      java.lang.String value)
        Add string translated into another language.
        Parameters:
        locale - its Locale.getISO3Language() stands for the language of the string. If is null, this method does nothing.
        value - string translated into provided language. If is null, this method does nothing.
        Returns:
        current I18nString.Builder instance
      • anyLanguage

        public I18nString.Builder anyLanguage​(@NonNull
                                              java.lang.String value)
        Add string to use as a default value, when there is no translation to some language
        Parameters:
        value - default string value If is null, this method does nothing.
        Returns:
        current I18nString.Builder instance