Convert a String to a Type using registered converters for the Type

@param           <T>

@param rawString
@param type
@return
972695
public Object convert(String rawString, Type type) {
        Object value = convert(rawString, type, null);
        return value;
    }
1180360
private void setTypeString(final String type) {
        if (type == null) {
            this.type = null;
        } else if (type.equalsIgnoreCase("WARN")) {
            this.type = Type.WARN;
        } else if (type.equalsIgnoreCase("ERROR")) {
            this.type = Type.ERROR;
        } else if (type.equalsIgnoreCase("DEBUG")) {
            this.type = Type.DEBUG;
        } else if (type.equalsIgnoreCase("INFO")) {
            this.type = Type.INFO;
        }
    }
518792
public static String toStringWithNamedGenerics(final Class<?> type) {
        return toStringType(new ParameterizedTypeImpl(type, type.getTypeParameters()), new PrintableGenericsMap());
    }
123477
public <T> T cleanupValue(T rawValue) {
        T cleanValue;
        if (rawValue instanceof String) {
            cleanValue = (T) cleanupValue((String) rawValue);
        } else {
            cleanValue = rawValue;
        }
        return cleanValue;
    }
608629
public String convert(String type) {
		if (isImplicitSarlTypes() && type.startsWith(IMPLICIT_PACKAGE)) {
			return type;
		}
		if (this.mapping == null) {
			this.mapping = initMapping();
		}
		final String map = this.mapping.get(type);
		if (map != null) {
			if (map.isEmpty() && !isImplicitJvmTypes()) {
				return null;
			}
			return map;
		}
		if (isImplicitJvmTypes()) {
			return type;
		}
		return null;
	}
1275122
@Override
    public String getCharsetFromContentType(String type) {
        if (null != type) {
            int index = type.indexOf(';');
            if (-1 != index) {
                index = type.indexOf("charset=", (index + 1));
                if (-1 != index) {
                    String charset = type.substring(index + 8).trim();
                    int end = charset.length() - 1;
                    if (-1 == end) {
                        // empty value following charset=
                        return null;
                    }
                    if (end > 0 && '"' == charset.charAt(0) && '"' == charset.charAt(end)) {
                        // strip off quotes if both exist
                        charset = charset.substring(1, end);
                    }
                    return charset;
                }
            }
        }
        return null;
    }
1081000
public <T> T convert(Type type, Object value, T defaultValue) throws ConvertException {
		return convert(type, value, defaultValue, true);
	}
1073837
private static String parameterizedTypeToString(final ParameterizedType p) {
        final StringBuilder buf = new StringBuilder();

        final Type useOwner = p.getOwnerType();
        final Class<?> raw = (Class<?>) p.getRawType();

        if (useOwner == null) {
            buf.append(raw.getName());
        } else {
            if (useOwner instanceof Class<?>) {
                buf.append(((Class<?>) useOwner).getName());
            } else {
                buf.append(useOwner.toString());
            }
            buf.append('.').append(raw.getSimpleName());
        }

        final int[] recursiveTypeIndexes = findRecursiveTypes(p);

        if (recursiveTypeIndexes.length > 0) {
            appendRecursiveTypes(buf, recursiveTypeIndexes, p.getActualTypeArguments());
        } else {
            appendAllTo(buf.append('<'), ", ", p.getActualTypeArguments()).append('>');
        }

        return buf.toString();
    }
147344
public static <E extends Enum<E>> EnumStringConverter<E> create(Class<E> enumType) {
        return new EnumStringConverter<E>(enumType);
    }
1058402
private Object deserialize(TypeInfo type, Object rawValue)
            throws SerDeException {
        Object value = null;

        if (rawValue != null) {
            switch (type.getCategory()) {
                case PRIMITIVE:
                    value = deserializePrimitive((PrimitiveTypeInfo) type, rawValue);
                    break;
                case STRUCT:
                    value = deserializeStruct((StructTypeInfo) type, rawValue);
                    break;
                case MAP:
                    value = deserializeMap((MapTypeInfo) type, rawValue);
                    break;
                case LIST:
                    value = deserializeList((ListTypeInfo) type, rawValue);
                    break;
                case UNION:
                    value = deserializeUnion((UnionTypeInfo) type, rawValue);
                    break;
            }
        }

        return value;
    }
151209
private static <T> StringConverter<T> defaultStringConverter() {
        return new StringConverter<T>() {
            @Override
            public String toString(T t) {
                return t == null ? null : t.toString();
            }

            @Override
            public T fromString(String string) {
                return (T) string;
            }
        };
    }
351924
private static String wildcardTypeParametersString(TypeElement type) {
    List<? extends TypeParameterElement> typeParameters = type.getTypeParameters();
    if (typeParameters.isEmpty()) {
      return "";
    } else {
      return typeParameters.stream().map(e -> "?").collect(joining(", ", "<", ">"));
    }
  }
134136
@SuppressWarnings("unchecked")
    private <T> ConversionStatus convertGenericClazz(String rawString, Class<T> type, TypeVariable<?> typeVariable) {
        ConversionStatus status = new ConversionStatus();
        AnnotatedType[] bounds = typeVariable.getAnnotatedBounds();
        for (AnnotatedType bound : bounds) {
            Type bType = bound.getType();
            if (bType instanceof Class) {
                Class<?> bClazz = (Class<?>) bType;
                if (bClazz.isAssignableFrom(type)) {
                    T converted = (T) convert(rawString, typeVariable);
                    status.setConverted(converted);
                    break;
                }
            }
        }

        return status;
    }
872585
@SuppressWarnings("unchecked")
	public <T> Converter<T> getCustomConverter(Type type) {
		return (null == customConverterMap) ? null : (Converter<T>) customConverterMap.get(type);
	}
619762
public static InstantType parseV3(String theV3String) {
		InstantType retVal = new InstantType();
		retVal.setValueAsV3String(theV3String);
		return retVal;
	}
656559
public int convertStringToSQLType(String type) {
        if (_typeSqlNameMap.containsKey(type.toUpperCase())) {
            return _typeSqlNameMap.get(type.toUpperCase());
        }
        return TYPE_UNKNOWN;
    }
1016599
public <X> T value(X value, String subType) throws IOException {
		return text(stringifierFactory.toString(value, subType));
	}