mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-11 18:12:57 +00:00
#355 document, abstract base, traits and example domain
This commit is contained in:
1 parent
c1187ae0d7
commit
913411773f
7 files changed
+147
No files matched your search
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user