@Test public void testResolveTypeReflectToReflect() { Class<String> type = String.class; Schema schema = Schema.create(Schema.Type.STRING); Class expResult = type; Class result = DataModelUtil.resolveType(type, schema); assertEquals(expResult, result); }
@SuppressWarnings("unchecked") public static <E> Class<E> resolveType(Class<E> type, Schema schema) { if (type == Object.class) { type = ReflectData.get().getClass(schema); } if (type == null) { type = (Class<E>) GenericData.Record.class; } return type; }
DataModelUtil { @SuppressWarnings("unchecked") public static <E> Class<E> resolveType(Class<E> type, Schema schema) { if (type == Object.class) { type = ReflectData.get().getClass(schema); } if (type == null) { type = (Class<E>) GenericData.Record.class; } return type; } }
DataModelUtil { @SuppressWarnings("unchecked") public static <E> Class<E> resolveType(Class<E> type, Schema schema) { if (type == Object.class) { type = ReflectData.get().getClass(schema); } if (type == null) { type = (Class<E>) GenericData.Record.class; } return type; }  }
DataModelUtil { @SuppressWarnings("unchecked") public static <E> Class<E> resolveType(Class<E> type, Schema schema) { if (type == Object.class) { type = ReflectData.get().getClass(schema); } if (type == null) { type = (Class<E>) GenericData.Record.class; } return type; }  static GenericData getDataModelForType(Class<E> type); static boolean isGeneric(Class<?> type); @SuppressWarnings("unchecked") static DatumReader<E> getDatumReaderForType(Class<E> type, Schema writerSchema); @SuppressWarnings("unchecked") static Class<E> resolveType(Class<E> type, Schema schema); static Schema getReaderSchema(Class<E> type, Schema schema); static Schema getWriterSchema(Class<E> type, Schema schema); @SuppressWarnings("unchecked") static E createRecord(Class<E> type, Schema schema); static EntityAccessor<E> accessor(Class<E> type, Schema schema); }
DataModelUtil { @SuppressWarnings("unchecked") public static <E> Class<E> resolveType(Class<E> type, Schema schema) { if (type == Object.class) { type = ReflectData.get().getClass(schema); } if (type == null) { type = (Class<E>) GenericData.Record.class; } return type; }  static GenericData getDataModelForType(Class<E> type); static boolean isGeneric(Class<?> type); @SuppressWarnings("unchecked") static DatumReader<E> getDatumReaderForType(Class<E> type, Schema writerSchema); @SuppressWarnings("unchecked") static Class<E> resolveType(Class<E> type, Schema schema); static Schema getReaderSchema(Class<E> type, Schema schema); static Schema getWriterSchema(Class<E> type, Schema schema); @SuppressWarnings("unchecked") static E createRecord(Class<E> type, Schema schema); static EntityAccessor<E> accessor(Class<E> type, Schema schema);  }