@Test void buildSchemaAndDumpToToml() throws Exception { SchemaBuilder builder = SchemaBuilder.create(); builder.addString("somekey", "somevalue", "Got milk", null); builder.addBoolean("foo", false, "Toggle switch", null); builder.addDouble("bar", 1.0, "Value of currency", null); builder.addLong("'Here now'", 123L, "One two three", null); builder.addString("'No defaults'", null, null, null); Configuration config = Configuration.fromToml("", builder.toSchema()); String expected = "## One two three\n" + "#\"Here now\" = 123\n" + "## Value of currency\n" + "#bar = 1.0\n" + "## Toggle switch\n" + "#foo = false\n" + "## Got milk\n" + "#somekey = \"somevalue\"\n"; assertEquals(expected.replace("\n", System.lineSeparator()), config.toToml()); }
@Override public void toToml(Appendable appendable) throws IOException { new TomlSerializer(this, schema).writeTo(appendable); }
TomlBackedConfiguration implements Configuration { @Override public void toToml(Appendable appendable) throws IOException { new TomlSerializer(this, schema).writeTo(appendable); } }
TomlBackedConfiguration implements Configuration { @Override public void toToml(Appendable appendable) throws IOException { new TomlSerializer(this, schema).writeTo(appendable); } TomlBackedConfiguration(TomlParseResult toml, @Nullable Schema schema); }
TomlBackedConfiguration implements Configuration { @Override public void toToml(Appendable appendable) throws IOException { new TomlSerializer(this, schema).writeTo(appendable); } 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 { @Override public void toToml(Appendable appendable) throws IOException { new TomlSerializer(this, schema).writeTo(appendable); } 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);  }