@Test void loadMissingFile() { assertThrows(NoSuchFileException.class, () -> { Configuration.fromToml(Paths.get("FileThatDoesntExist")); }); }
@Nullable @Override public Object get(String key) { Object obj = toml.get(key); if (obj != null) { if (obj instanceof TomlArray) { return deepToList((TomlArray) obj); } if (obj instanceof TomlTable) { return deepToMap((TomlTable) obj); } return obj; } return schema.getDefault(key); }
TomlBackedConfiguration implements Configuration { @Nullable @Override public Object get(String key) { Object obj = toml.get(key); if (obj != null) { if (obj instanceof TomlArray) { return deepToList((TomlArray) obj); } if (obj instanceof TomlTable) { return deepToMap((TomlTable) obj); } return obj; } return schema.getDefault(key); } }
TomlBackedConfiguration implements Configuration { @Nullable @Override public Object get(String key) { Object obj = toml.get(key); if (obj != null) { if (obj instanceof TomlArray) { return deepToList((TomlArray) obj); } if (obj instanceof TomlTable) { return deepToMap((TomlTable) obj); } return obj; } return schema.getDefault(key); } TomlBackedConfiguration(TomlParseResult toml, @Nullable Schema schema); }
TomlBackedConfiguration implements Configuration { @Nullable @Override public Object get(String key) { Object obj = toml.get(key); if (obj != null) { if (obj instanceof TomlArray) { return deepToList((TomlArray) obj); } if (obj instanceof TomlTable) { return deepToMap((TomlTable) obj); } return obj; } return schema.getDefault(key); } TomlBackedConfiguration(TomlParseResult toml, @Nullable Schema schema); @Override List<ConfigurationError> errors(); @Override void toToml(Appendable appendable); @Override Set<String> keySet(); @Override boolean contains(String key); @Nullable @Override Object get(String key); @Nullable @Override DocumentPosition inputPositionOf(String key); @Override String getString(String key); @Override int getInteger(String key); @Override long getLong(String key); @Override double getDouble(String key); @Override boolean getBoolean(String key); @Override Map<String, Object> getMap(String key); @Override List<Object> getList(String key); @Override List<String> getListOfString(String key); @Override List<Integer> getListOfInteger(String key); @Override List<Long> getListOfLong(String key); @Override List<Double> getListOfDouble(String key); @Override List<Boolean> getListOfBoolean(String key); @Override List<Map<String, Object>> getListOfMap(String key); }
TomlBackedConfiguration implements Configuration { @Nullable @Override public Object get(String key) { Object obj = toml.get(key); if (obj != null) { if (obj instanceof TomlArray) { return deepToList((TomlArray) obj); } if (obj instanceof TomlTable) { return deepToMap((TomlTable) obj); } return obj; } return schema.getDefault(key); } TomlBackedConfiguration(TomlParseResult toml, @Nullable Schema schema); @Override List<ConfigurationError> errors(); @Override void toToml(Appendable appendable); @Override Set<String> keySet(); @Override boolean contains(String key); @Nullable @Override Object get(String key); @Nullable @Override DocumentPosition inputPositionOf(String key); @Override String getString(String key); @Override int getInteger(String key); @Override long getLong(String key); @Override double getDouble(String key); @Override boolean getBoolean(String key); @Override Map<String, Object> getMap(String key); @Override List<Object> getList(String key); @Override List<String> getListOfString(String key); @Override List<Integer> getListOfInteger(String key); @Override List<Long> getListOfLong(String key); @Override List<Double> getListOfDouble(String key); @Override List<Boolean> getListOfBoolean(String key); @Override List<Map<String, Object>> getListOfMap(String key);  }