Class HamsterConfig
java.lang.Object
de.hamstersimulator.objectsfirst.config.HamsterConfig
-
Method Summary
Modifier and TypeMethodDescriptionReturns the list of class names o be used for the exercises.Returns the string name of the default output interface to usestatic HamsterConfig
load()
Loads the config from the default file:config.json
static HamsterConfig
Loads the config from the specified JSON-file and returns a new instance
-
Method Details
-
getExercises
Returns the list of class names o be used for the exercises. The order is important as it is used to map the exercises to the tests- Returns:
- An unmodifiable version of the list of exercise classes
-
getOutput
Returns the string name of the default output interface to use- Returns:
- The string of the output interface to use. This can be null if it's not given in the JSON
-
load
Loads the config from the default file:config.json
- Returns:
- A new instance of
HamsterConfig
with the data loaded from the JSON-file - Throws:
IOException
- If the loading of the JSON-file fails (e.g. because the file doesn't exist or isn't readable)
-
load
Loads the config from the specified JSON-file and returns a new instance- Parameters:
path
- The absolute or relative path to the JSON-file to be loaded as config This can't be null or empty- Returns:
- A new instance of
HamsterConfig
with the data loaded from the JSON-file - Throws:
IOException
- If the loading of the JSON-file fails (e.g. because the file doesn't exist or isn't readable)
-