added .travis.yml

dev
Exlll 8 years ago
parent 720ca8f47f
commit 3bf8e64d93

@ -0,0 +1,3 @@
language: java
jdk:
oraclejdk8

@ -15,18 +15,6 @@ final class FieldMapper {
this.streamSupplier = streamSupplier;
}
// TODO remove if unneccessary
// Map<String, Field> mapFieldNamesToFields() {
// Collector<Field, ?, Map<String, Field>> fieldCollector = Collectors.toMap(
// Field::getName,
// Function.identity(),
// (field1, field2) -> field1,
// LinkedHashMap::new
// );
//
// return streamSupplier.get().collect(fieldCollector);
// }
Map<String, Object> mapFieldNamesToValues(Object instance) {
Map<String, Object> valuesByFieldNames = new LinkedHashMap<>();
List<Field> fields = streamSupplier.get().collect(Collectors.toList());

@ -25,15 +25,6 @@ public class FieldMapperTest {
new FieldMapper(null);
}
// @Test
// public void mapFieldNamesToFields() throws Exception {
// Map<String, Field> 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();

@ -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 {

Loading…
Cancel
Save