Package com.basistech.rosette.dm
Class TransliterationResults.Builder
java.lang.Object
com.basistech.rosette.dm.BaseAttribute.Builder<TransliterationResults,TransliterationResults.Builder>
com.basistech.rosette.dm.TransliterationResults.Builder
- Enclosing class:
- TransliterationResults
public static class TransliterationResults.Builder
extends BaseAttribute.Builder<TransliterationResults,TransliterationResults.Builder>
Builder for immutable
TransliterationResults-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()Creates a new empty builder (one with noTransliterations)Builder(TransliterationResults other) Creates a new builder whose state starts out with a copy of the givenTransliterationResultsBuilder(com.basistech.util.LanguageCode languageCode, com.basistech.util.ISO15924 script, String transliteration) Creates a new builder with aTransliterationcontaining the given transliteration under the languagelanguageCode -
Method Summary
Modifier and TypeMethodDescriptionaddTransliteration(com.basistech.util.LanguageCode languageCode, Transliteration transliteration) Adds the givenTransliterationunder the givenLanguageCodebuild()Creates a new immutableTransliterationResultsfrom the internal state of this builder.Clears the current transliterations for all languagesprotected TransliterationResults.BuildergetThis()transliteration(Map<com.basistech.util.LanguageCode, Transliteration> transliterations) Sets this builder's internal transliterations mapping to a copy of the given one.Methods inherited from class com.basistech.rosette.dm.BaseAttribute.Builder
addAllToList, addAllToSet, buildExtendedProperties, extendedProperties, extendedProperty, nullOrList
-
Constructor Details
-
Builder
public Builder(com.basistech.util.LanguageCode languageCode, com.basistech.util.ISO15924 script, String transliteration) Creates a new builder with aTransliterationcontaining the given transliteration under the languagelanguageCode- Parameters:
languageCode- The language code to put the new transliteration under.script- The script for the new transliteration.transliteration- The text for the new transliteration.
-
Builder
public Builder()Creates a new empty builder (one with noTransliterations) -
Builder
Creates a new builder whose state starts out with a copy of the givenTransliterationResults- Parameters:
other- The transliteration to start from.
-
-
Method Details
-
addTransliteration
public TransliterationResults.Builder addTransliteration(com.basistech.util.LanguageCode languageCode, Transliteration transliteration) Adds the givenTransliterationunder the givenLanguageCode- Parameters:
languageCode- The language code to add undertransliteration- The transliteration to add- Returns:
this
-
transliteration
public TransliterationResults.Builder transliteration(Map<com.basistech.util.LanguageCode, Transliteration> transliterations) Sets this builder's internal transliterations mapping to a copy of the given one.- Parameters:
transliterations- The new transliterations- Returns:
this
-
clearResults
Clears the current transliterations for all languages- Returns:
- this
-
build
Creates a new immutableTransliterationResultsfrom the internal state of this builder.- Returns:
- The new
TransliterationResults
-
getThis
- Specified by:
getThisin classBaseAttribute.Builder<TransliterationResults,TransliterationResults.Builder>
-