#355 override toString to log properties

This commit is contained in:
qza
2016-06-02 07:27:35 +02:00
parent 32b647323c
commit a372f05e41

View File

@ -31,8 +31,19 @@ public abstract class AbstractDocument implements Document {
return Stream.of(get(key))
.filter(el -> el != null)
.map(el -> (List<Map<String, Object>>) el)
.findFirst().get().stream()
.findAny().get().stream()
.map(constructor);
}
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append(getClass().getName()).append("[");
properties.entrySet().forEach(e ->
builder.append("[").append(e.getKey()).append(" : ").append(e.getValue()).append("]")
);
builder.append("]");
return builder.toString();
}
}