Package net.starype.quiz.api.parser
Class DifficultyMapper
- java.lang.Object
-
- net.starype.quiz.api.parser.DifficultyMapper
-
- All Implemented Interfaces:
ConfigMapper<QuestionDifficulty>
public class DifficultyMapper extends java.lang.Object implements ConfigMapper<QuestionDifficulty>
-
-
Constructor Summary
Constructors Constructor Description DifficultyMapper(java.lang.String name, QuestionDifficulty difficulty)
-
Method Summary
Modifier and Type Method Description java.lang.StringgetMapperName()QuestionDifficultymap(ReadableMap config)Produce a result of a specific type.
-
-
-
Constructor Detail
-
DifficultyMapper
public DifficultyMapper(java.lang.String name, QuestionDifficulty difficulty)
-
-
Method Detail
-
getMapperName
public java.lang.String getMapperName()
- Specified by:
getMapperNamein interfaceConfigMapper<QuestionDifficulty>- Returns:
- the value that may match a key from a TOML configuration file
-
map
public QuestionDifficulty map(ReadableMap config)
Description copied from interface:ConfigMapperProduce a result of a specific type.
The configuration object may be used to gather additional information required to construct the object.- Specified by:
mapin interfaceConfigMapper<QuestionDifficulty>- Parameters:
config- the configuration object loaded from the file- Returns:
- a result representing the value
-
-