1 package eu.ehri.project.persistence;
2
3 import com.google.common.collect.Multimap;
4
5 import java.util.List;
6
7
8
9
10
11
12 public interface NestableData<N> {
13
14 Multimap<String, N> getRelations();
15
16 List<N> getRelations(String relation);
17
18 boolean hasRelations(String relation);
19
20 <T> T getDataValue(String key);
21
22 N withRelations(Multimap<String, N> relations);
23
24 N withRelations(String name, List<N> relations);
25
26 N withRelation(String name, N value);
27
28 N replaceRelations(Multimap<String, N> relations);
29
30 N withDataValue(String key, Object value);
31
32 N removeDataValue(String key);
33 }