/** * * @param value the stringified value * @param schema the schema of the type * @param type a non-complex type to convert to * @return the converted value */ public static Object convertSimpleValue(final String value, final DataSchema schema, final Class<?> type) { DataSchema.Type dereferencedType = schema.getDereferencedType(); Object underlyingValue; if (schema.getDereferencedDataSchema().isComplex()) { underlyingValue = value; } else { underlyingValue = ValueConverter.coerceString(value, DataSchemaUtil.dataSchemaTypeToPrimitiveDataSchemaClass(dereferencedType)); } return DataTemplateUtil.coerceOutput(underlyingValue, type); }