public static Type from(String typeString) {
            if (typeString.startsWith("annotationreference<"))
                return new Type(Kind.ANNOTATIONREFERENCE); // TODO: Model as subclass
            if (typeString.startsWith("array<"))
                return new Type(Kind.ARRAY); // TODO: Model as subclass
            if (typeString.equals("bool"))
                return new Type(Kind.BOOL);
            if (typeString.equals("byte"))
                return new Type(Kind.BYTE);
            if (typeString.equals("double"))
                return new Type(Kind.DOUBLE);
            if (typeString.equals("float"))
                return new Type(Kind.FLOAT);
            if (typeString.equals("int"))
                return new Type(Kind.INT);
            if (typeString.equals("long"))
                return new Type(Kind.LONG);
            if (typeString.startsWith("map<"))
                return new Type(Kind.MAP); // TODO: Model as subclass
            if (typeString.equals("position"))
                return new Type(Kind.POSITION);
            if (typeString.equals("predicate"))
                return new Type(Kind.PREDICATE);
            if (typeString.equals("raw"))
                return new Type(Kind.RAW);
            if (typeString.startsWith("reference<"))
                return new Type(Kind.REFERENCE); // TODO: Model as subclass
            if (typeString.equals("string"))
                return new Type(Kind.STRING);
            if (typeString.startsWith("tensor<") || typeString.startsWith("tensor("))
                return new TensorFieldType(TensorType.fromSpec(typeString));
            if (typeString.equals("url"))
                return new Type(Kind.URL);
            if (typeString.startsWith("weightedset<"))
                return new Type(Kind.WEIGHTEDSET); // TODO: Model as subclass
            else
                return new Type(Kind.STRUCT); // TODO: Model as a subclass
        }
Creates this from a type string on the syntax following "field [name] type " in a schema definition.
container-search/src/main/java/com/yahoo/search/schema/Field.java