@Nullable @Override public <T> SerializableFunction<T, Row> toRowFunction(TypeDescriptor<T> typeDescriptor) { SchemaProvider schemaProvider = providers.get(typeDescriptor); return (schemaProvider != null) ? schemaProvider.toRowFunction(typeDescriptor) : null; }
/** * Given a type, return a function that converts that type to a {@link Row} object If no schema * exists, returns null. */ @Override public <T> SerializableFunction<T, Row> toRowFunction(TypeDescriptor<T> typeDescriptor) { SchemaProvider schemaProvider = getSchemaProvider(typeDescriptor); return (schemaProvider != null) ? schemaProvider.toRowFunction(typeDescriptor) : null; }
/** Rerieve the function that converts an object of the specified type to a {@link Row} object. */ public <T> SerializableFunction<T, Row> getToRowFunction(TypeDescriptor<T> typeDescriptor) throws NoSuchSchemaException { SchemaEntry entry = entries.get(typeDescriptor); if (entry != null) { return entry.toRow; } return getProviderResult((SchemaProvider p) -> p.toRowFunction(typeDescriptor)); }