vitrivr / vitrivr-engine

vitrivr's next-generation retrieval engine. It is capable of extracting and retrieving a wider range of multimedia objects such as audio, video, images or 3d models.
https://vitrivr.org
MIT License
6 stars 3 forks source link

Change: Immutable Descriptors #93

Closed ppanopticon closed 3 months ago

ppanopticon commented 3 months ago

It was requested, that Descriptors should be immutable. This PR implements this change.

Since there are cases, where we need to be able to re-assign the id, the retrievableId or the field, every Descriptor now implements a copy() method that can be used to create copies and overwrite these attributes. This works generically, i.e., without knowing the concrete type of Descriptor.

The PR also necessitated a change to the MapStructDescriptor. This class is now abstract. There is a new, concrete implementation called AnyMapStructDescriptor which covers the case where the fields are configured at runtime.