public static < E > GenericData getDataModelForType ( Class < E > type ) { // Need to check if SpecificRecord first because specific records also // implement GenericRecord if ( SpecificRecord . class . isAssignableFrom ( type ) ) { return new SpecificData ( type . getClassLoader ( ) ) ; } else if ( IndexedRecord . class . isAssignableFrom ( type ) ) { return GenericData . get ( ) ; } else { return AllowNulls . get ( ) ; } }
Get the data model for the given type .