java.lang.Object
de.hamstersimulator.objectsfirst.config.HamsterConfig

public class HamsterConfig extends Object
  • Method Details

    • getExercises

      public List<String> 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

      public String 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

      public static HamsterConfig load() throws IOException
      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

      public static HamsterConfig load(String path) throws IOException
      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)