File tree 3 files changed +10
-0
lines changed
java/arcs/core/storage/api
3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ package arcs.core.storage.api
13
13
14
14
import arcs.core.common.Referencable
15
15
import arcs.core.data.RawEntity
16
+ import arcs.core.data.Schema
16
17
import arcs.core.data.util.ReferencablePrimitive
17
18
import kotlin.IllegalArgumentException
18
19
import kotlin.reflect.KClass
@@ -38,6 +39,9 @@ interface EntitySpec<T : Entity> {
38
39
* TODO: replace this with kotlinx.serialization
39
40
*/
40
41
fun deserialize (data : RawEntity ): T
42
+
43
+ /* * Returns the corresponding [Schema] for the specified [Entity]. */
44
+ fun schema (): Schema
41
45
}
42
46
43
47
/* *
Original file line number Diff line number Diff line change @@ -315,6 +315,8 @@ ${this.opts.wasm ? '' : `\
315
315
SchemaRegistry.register(schema)
316
316
}
317
317
}
318
+
319
+ override fun schema() = schema
318
320
` }
319
321
override fun create() = ${ name } ()
320
322
${ ! this . opts . wasm ? `
Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ class GoldInternal1_Spec() : EntitySpec<GoldInternal1> {
87
87
}
88
88
}
89
89
90
+ override fun schema () = schema
91
+
90
92
override fun create () = GoldInternal1 ()
91
93
92
94
override fun deserialize (data : RawEntity ): GoldInternal1 {
@@ -215,6 +217,8 @@ class Gold_Data_Spec() : EntitySpec<Gold_Data> {
215
217
}
216
218
}
217
219
220
+ override fun schema () = schema
221
+
218
222
override fun create () = Gold_Data ()
219
223
220
224
override fun deserialize (data : RawEntity ): Gold_Data {
You can’t perform that action at this time.
0 commit comments