Class JsonFiles

java.lang.Object
lv.id.jc.dicechess.runtime.JsonFiles

public final class JsonFiles extends Object
Loads a JSON object of string keys to string values from a file — the shape an opening book, or any similarly simple lookup table, is exported as.
  • Method Details

    • loadStringMap

      public static Map<String,String> loadStringMap(Path path)
      Loads path as a JSON object of string to string.
      Parameters:
      path - the file to load
      Returns:
      the parsed map, or an empty map if path does not exist
      Throws:
      UncheckedIOException - if path exists but cannot be read
      IllegalArgumentException - if path's content is not a JSON object of strings