diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..45395aa --- /dev/null +++ b/.travis.yml @@ -0,0 +1,3 @@ +language: java +jdk: + oraclejdk8 diff --git a/ConfigLib-Core/src/main/java/de/exlll/configlib/FieldMapper.java b/ConfigLib-Core/src/main/java/de/exlll/configlib/FieldMapper.java index 1e5ea6c..1bad8a3 100644 --- a/ConfigLib-Core/src/main/java/de/exlll/configlib/FieldMapper.java +++ b/ConfigLib-Core/src/main/java/de/exlll/configlib/FieldMapper.java @@ -15,18 +15,6 @@ final class FieldMapper { this.streamSupplier = streamSupplier; } -// TODO remove if unneccessary -// Map mapFieldNamesToFields() { -// Collector> fieldCollector = Collectors.toMap( -// Field::getName, -// Function.identity(), -// (field1, field2) -> field1, -// LinkedHashMap::new -// ); -// -// return streamSupplier.get().collect(fieldCollector); -// } - Map mapFieldNamesToValues(Object instance) { Map valuesByFieldNames = new LinkedHashMap<>(); List fields = streamSupplier.get().collect(Collectors.toList()); diff --git a/ConfigLib-Core/src/test/java/de/exlll/configlib/FieldMapperTest.java b/ConfigLib-Core/src/test/java/de/exlll/configlib/FieldMapperTest.java index 3ae8025..3964b81 100644 --- a/ConfigLib-Core/src/test/java/de/exlll/configlib/FieldMapperTest.java +++ b/ConfigLib-Core/src/test/java/de/exlll/configlib/FieldMapperTest.java @@ -25,15 +25,6 @@ public class FieldMapperTest { new FieldMapper(null); } -// @Test -// public void mapFieldNamesToFields() throws Exception { -// Map fieldsByFieldNames = new LinkedHashMap<>(); -// fieldsByFieldNames.put("field1", TestClass.class.getDeclaredField("field1")); -// fieldsByFieldNames.put("field2", TestClass.class.getDeclaredField("field2")); -// fieldsByFieldNames.put("field3", TestClass.class.getDeclaredField("field3")); -// assertThat(fieldsByFieldNames, is(mapper.mapFieldNamesToFields())); -// } - @Test public void mapFieldNamesToValues() throws Exception { TestClass testClass = new TestClass(); diff --git a/README.md b/README.md index 8e16f06..615cfdc 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ If the file doesn't exist, it is saved. ##### Adding and removing fields In order to add or to remove fields, you just need to add them to or remove them from your -configuration class. The next time `save` or `load` is called, changes are saved to the +configuration class. The next time `save` or `loadAndSave` is called, changes are saved to the configuration file. ##### Comments @@ -68,7 +68,7 @@ public final class DatabaseConfig extends Configuration { ```java public class Plugin { public static void main(String[] args) { - Path path = ... + Path path = Paths.get("/dir1/dir2/config.yml"); DatabaseConfig config = new DatabaseConfig(path); try {