#355 document, abstract base, traits and example domain

This commit is contained in:
qza
2016-06-01 22:20:55 +02:00
parent c1187ae0d7
commit 913411773f
7 changed files with 147 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package com.iluwatar.abstractdocument;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Stream;
public interface Document {
/**
* Puts the value related to the key
*
* @param key
* @param value
* @return Void
*/
Void put(String key, Object value);
/**
* Gets the value for the key
*
* @param key
* @return value or null
*/
Object get(String key);
/**
* Gets the stream of child documents
*
* @param key
* @param constructor
* @return child documents
*/
<T> Stream<T> children(String key, Function<Map<String, Object>, T> constructor);
}