MappingElasticsearchConverter cleanup.

Original Pull Request #1931
Closes #1923
This commit is contained in:
Peter-Josef Meisch 2021-09-11 11:51:05 +02:00 committed by GitHub
parent 8ab84fcc7a
commit fa66702980
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1107,34 +1107,6 @@ public class MappingElasticsearchConverter
return writeMapInternal(map, new LinkedHashMap<>(map.size()), property.getTypeInformation());
}
/**
* @deprecated since 4.2, use {@link #getPotentiallyConvertedSimpleWrite(Object, Class)} instead.
*/
@Nullable
@Deprecated
protected Object getWriteSimpleValue(Object value) {
Optional<Class<?>> customTarget = conversions.getCustomWriteTarget(value.getClass());
if (customTarget.isPresent()) {
return conversionService.convert(value, customTarget.get());
}
return Enum.class.isAssignableFrom(value.getClass()) ? ((Enum<?>) value).name() : value;
}
/**
* @deprecated since 4.2, use {@link #writeInternal(Object, Map, TypeInformation)} instead.
*/
@Deprecated
protected Object getWriteComplexValue(ElasticsearchPersistentProperty property,
@SuppressWarnings("unused") TypeInformation<?> typeHint, Object value) {
Document document = Document.create();
writeInternal(value, document, property.getTypeInformation());
return document;
}
/**
* Returns given object as {@link Collection}. Will return the {@link Collection} as is if the source is a
* {@link Collection} already, will convert an array into a {@link Collection} or simply create a single element