Skip to content

Commit

Permalink
feat: remove field factory
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Jul 30, 2023
1 parent 6867c5f commit 6afc65a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ class ClassConverter {
private static final Logger LOGGER = Logger.getLogger(ClassConverter.class.getName());

private Reflections reflections;

private FieldWriterFactory writerFactory;

private InstanceSupplierFactory instanceSupplierFactory;
private InstanceSupplierFactory instanceSupplierFactory;

private ConstructorMetadataBuilder constructorMetadataBuilder;

Expand All @@ -50,7 +47,6 @@ class ClassConverter {
ClassConverter(Reflections reflections) {

this.reflections = reflections;
this.writerFactory = new FieldWriterFactory(reflections);
this.instanceSupplierFactory = new ReflectionInstanceSupplierFactory(reflections);
this.constructorMetadataBuilder = new ConstructorMetadataBuilder(reflections);
}
Expand Down Expand Up @@ -184,7 +180,7 @@ private FieldMapping to(Field field) {
FieldMappingBuilder builder = new FieldMappingBuilder().withName(columnName)
.withField(field).withType(mappingType).withId(id)
.withReader(bean -> reflections.getValue(bean, field))
.withWriter(writerFactory.apply(field));
.withWriter( (bean, value) -> reflections.setValue(bean, field, value));

if (nonNull(convert)) {
builder.withConverter(convert.value());
Expand Down

This file was deleted.

0 comments on commit 6afc65a

Please sign in to comment.