Package es.situm.sdk.model
Class I18nString.Builder
- java.lang.Object
-
- es.situm.sdk.model.I18nString.Builder
-
- Enclosing class:
- I18nString
public static final class I18nString.Builder extends java.lang.Object
Allows creating a I18nString in a handier way.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(I18nString toCopy)
Builder(java.lang.String defaultValue)
-
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 languageI18nString
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.
-
-
-
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
- itsLocale.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
-
build
public I18nString build()
- Returns:
- new
I18nString
instance
-
-