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 Object
Allows creating a I18nString in a handier way.
-
-
Constructor Summary
Constructors Constructor Description Builder()Builder(I18nString toCopy)Builder(String defaultValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description I18nString.BuilderanyLanguage(String value)Add string to use as a default value, when there is no translation to some languageI18nStringbuild()I18nString.Builderput(String languageCode, String value)Add string translated into another language.I18nString.Builderput(Locale locale, String value)Add string translated into another language.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(@NonNull String defaultValue)
-
Builder
public Builder(@NonNull I18nString toCopy)
-
-
Method Detail
-
put
public I18nString.Builder put(@NonNull String languageCode, @NonNull 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.Builderinstance
-
put
public I18nString.Builder put(@NonNull Locale locale, @NonNull 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.Builderinstance
-
anyLanguage
public I18nString.Builder anyLanguage(@NonNull 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.Builderinstance
-
build
public I18nString build()
- Returns:
- new
I18nStringinstance
-
-