public static class TranslatorMode.Builder extends Object
Modifier and Type | Method and Description |
---|---|
TranslatorMode |
build()
Builds a new
TranslatorMode instance based on the current configuration
of this builder. |
TranslatorMode.Builder |
description(String value)
Set the description for this mode.
|
TranslatorMode.Builder |
displayName(String value)
Set the display name for this mode.
|
TranslatorMode.Builder |
dotsPerCell(Optional<TranslatorMode.DotsPerCell> value)
Set the number of dots per cell.
|
TranslatorMode.Builder |
dotsPerCell(TranslatorMode.DotsPerCell value)
Set the number of dots per cell.
|
TranslatorMode.Builder |
grade(double grade)
Sets the contraction grade.
|
TranslatorMode.Builder |
identifier(String value)
Sets the identifier.
|
static TranslatorMode.Builder |
parse(String str)
Parses the string as translator mode segments and sets the builder accordingly.
|
TranslatorMode.Builder |
type(TranslatorType type)
Sets the translator type.
|
static TranslatorMode.Builder |
withGrade(double grade)
Creates a new translator mode builder with the specified contraction grade.
|
static TranslatorMode.Builder |
withIdentifier(String identifier)
Creates a new translator mode builder with the specified identifier.
|
static TranslatorMode.Builder |
withType(TranslatorType type)
Creates a new translator mode builder with the specified type.
|
public static TranslatorMode.Builder withIdentifier(String identifier)
identifier
- the identifierpublic static TranslatorMode.Builder withType(TranslatorType type)
type
- the translator typepublic static TranslatorMode.Builder withGrade(double grade)
Note that setting the contraction grade implies that the translator type is
contracted
even though in some locales a particular contraction grade
could have another meaning, for example that the braille is not contracted.
grade
- the contraction gradepublic static TranslatorMode.Builder parse(String str)
str
- the input stringIllegalArgumentException
- if parsing failspublic TranslatorMode.Builder identifier(String value)
value
- the identifierpublic TranslatorMode.Builder grade(double grade)
grade
- the contraction gradepublic TranslatorMode.Builder type(TranslatorType type)
type
- the typepublic TranslatorMode.Builder displayName(String value)
value
- the display namepublic TranslatorMode.Builder description(String value)
value
- the descriptionpublic TranslatorMode.Builder dotsPerCell(Optional<TranslatorMode.DotsPerCell> value)
value
- dots per cellpublic TranslatorMode.Builder dotsPerCell(TranslatorMode.DotsPerCell value)
value
- dots per cellpublic TranslatorMode build()
TranslatorMode
instance based on the current configuration
of this builder.TranslatorMode
instance