|
7 | 7 |
|
8 | 8 | import static java.util.Objects.requireNonNull; |
9 | 9 |
|
10 | | -public final class ResourceHandle implements ILookup, IKeywordLookup { |
| 10 | +public final class ResourceHandle implements ILookup, IKeywordLookup, IObj { |
11 | 11 |
|
12 | 12 | public static final Comparator<ResourceHandle> ID_CMP = Comparator.comparing(rh -> rh.id); |
13 | 13 |
|
@@ -85,14 +85,16 @@ public static Keyword op(long state) { |
85 | 85 | private final long t; |
86 | 86 | private final Hash hash; |
87 | 87 | private final long state; |
| 88 | + private final IPersistentMap meta; |
88 | 89 |
|
89 | | - public ResourceHandle(Keyword fhirType, int tid, String id, long t, Hash hash, long state) { |
| 90 | + public ResourceHandle(Keyword fhirType, int tid, String id, long t, Hash hash, long state, IPersistentMap meta) { |
90 | 91 | this.fhirType = requireNonNull(fhirType); |
91 | 92 | this.tid = tid; |
92 | 93 | this.id = requireNonNull(id); |
93 | 94 | this.t = t; |
94 | 95 | this.hash = requireNonNull(hash); |
95 | 96 | this.state = state; |
| 97 | + this.meta = meta; |
96 | 98 | } |
97 | 99 |
|
98 | 100 | @Override |
@@ -124,6 +126,16 @@ public ILookupThunk getLookupThunk(Keyword key) { |
124 | 126 | return null; |
125 | 127 | } |
126 | 128 |
|
| 129 | + @Override |
| 130 | + public IObj withMeta(IPersistentMap meta) { |
| 131 | + return new ResourceHandle(fhirType, tid, id, t, hash, state, meta); |
| 132 | + } |
| 133 | + |
| 134 | + @Override |
| 135 | + public IPersistentMap meta() { |
| 136 | + return meta; |
| 137 | + } |
| 138 | + |
127 | 139 | @Override |
128 | 140 | public boolean equals(Object o) { |
129 | 141 | if (this == o) return true; |
|
0 commit comments