Package org.daisy.dotify.api.translator
Class TranslatorMode
- java.lang.Object
-
- org.daisy.dotify.api.translator.TranslatorMode
-
- All Implemented Interfaces:
FactoryProperties
public final class TranslatorMode extends Object implements FactoryProperties
Provides information about a translator mode. This information could, for example, be used to find a translator that matches a given specification. The specification could be based on some translator mode properties or on its identifier.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTranslatorMode.BuilderProvides a translator mode builder.static classTranslatorMode.DotsPerCellProvides a definition of the number of dots in a braille cell.-
Nested classes/interfaces inherited from interface org.daisy.dotify.api.factory.FactoryProperties
FactoryProperties.ComparatorBuilder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Double>getContractionGrade()Gets the contraction grade, if set.StringgetDescription()Gets the description for this FactoryStringgetDisplayName()Gets the display name for this FactoryOptional<TranslatorMode.DotsPerCell>getDotsPerCell()Gets the number of dots per cell, if set.StringgetIdentifier()Gets the identifier for this FactoryOptional<TranslatorType>getType()Gets the mode type, if set.static TranslatorModeparse(String str)Parses the string as a translator mode.StringtoString()static TranslatorModewithGrade(double grade)Creates a new mode with the specified translation gradestatic TranslatorModewithType(TranslatorType type)Creates a new mode with the specified type.
-
-
-
Method Detail
-
parse
public static TranslatorMode parse(String str)
Parses the string as a translator mode.- Parameters:
str- the input string- Returns:
- a translator mode
- Throws:
IllegalArgumentException- if parsing fails
-
withType
public static TranslatorMode withType(TranslatorType type)
Creates a new mode with the specified type.- Parameters:
type- the type- Returns:
- a new instance
-
withGrade
public static TranslatorMode withGrade(double grade)
Creates a new mode with the specified translation grade- Parameters:
grade- the translation grade- Returns:
- a new instance
-
getContractionGrade
public Optional<Double> getContractionGrade()
Gets the contraction grade, if set.- Returns:
- the contraction grade.
-
getType
public Optional<TranslatorType> getType()
Gets the mode type, if set.- Returns:
- the type of mode
-
getDotsPerCell
public Optional<TranslatorMode.DotsPerCell> getDotsPerCell()
Gets the number of dots per cell, if set.- Returns:
- the dots per cell
-
getIdentifier
public String getIdentifier()
Description copied from interface:FactoryPropertiesGets the identifier for this Factory- Specified by:
getIdentifierin interfaceFactoryProperties- Returns:
- returns the identifier for this Factory
-
getDisplayName
public String getDisplayName()
Description copied from interface:FactoryPropertiesGets the display name for this Factory- Specified by:
getDisplayNamein interfaceFactoryProperties- Returns:
- returns the display name for this Factory
-
getDescription
public String getDescription()
Description copied from interface:FactoryPropertiesGets the description for this Factory- Specified by:
getDescriptionin interfaceFactoryProperties- Returns:
- returns the description for this Factory
-
-