This will allow some asXXX() methods in IndexSchemaFieldContext to return accessors that do simply offer a write(DocumentElement target, T value) method. This can be useful for:
- Dynamic fields, where we'd rather need .name(<name>).write(target, value)
- Exotic data types, such as geo_shapes, where we could accept more than one types: write(DocumentElement target, GeoCircle value), write(DocumentElement target, GeoPolygon value); or even custom-tailored methods avoiding the need of instantiating : writeCircle(DocumentElement target, GeoPoint center, double radius, DistanceUnit radiusUnit), ...
I'm not saying we should absolutely implement the two items above, just that with the change proposed in this ticket, we could, and we could even do it in later releases. So if something allows us to make APIs evolve without breaking them, it's probably a good thing. |