@Override public List<SchemaProvider> getSchemaProviders() { return ImmutableList.of(new DefaultSchemaProvider()); } }
@Override public <T> Schema schemaFor(TypeDescriptor<T> typeDescriptor) { SchemaProvider schemaProvider = getSchemaProvider(typeDescriptor); return (schemaProvider != null) ? schemaProvider.schemaFor(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; }
/** * Given a type, returns a function that converts from a {@link Row} object to that type. If no * schema exists, returns null. */ @Override public <T> SerializableFunction<Row, T> fromRowFunction(TypeDescriptor<T> typeDescriptor) { SchemaProvider schemaProvider = getSchemaProvider(typeDescriptor); return (schemaProvider != null) ? schemaProvider.fromRowFunction(typeDescriptor) : null; } }