Can this type-string-to-enum map be precalculated somewhere? It should not change at runtime, and then this code just becomes `return typeStringsToType.get(type)`.