We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cb8023 commit 579b2e6Copy full SHA for 579b2e6
java/arcs/core/data/SchemaRegistry.kt
@@ -10,17 +10,20 @@
10
*/
11
package arcs.core.data
12
13
+
14
+typealias SchemaHash = String
15
16
/**
17
* A registry for generated [Schema]s.
18
19
object SchemaRegistry {
- private val schemas: MutableMap<String, Schema> = mutableMapOf()
20
+ private val schemas = mutableMapOf<SchemaHash, Schema>()
21
22
/** Store a [Schema] in the registry. */
23
fun register(schema: Schema) {
24
schemas[schema.hash] = schema
25
}
26
- /** Given a schema hash as a [String], return the [Schema] for that hash, if it exists. */
- fun fromHash(hash: String) = schemas[hash]
27
+ /** Given a [SchemaHash], return the [Schema] for that hash, if it exists. */
28
+ fun fromHash(hash: SchemaHash) = schemas[hash]
29
0 commit comments