Package ru.objectsfill.service
Class CollectionElementCreationService
java.lang.Object
ru.objectsfill.service.CollectionElementCreationService
The CollectionElementCreationService class is responsible for generating collection elements
based on the field type and the Fill object provided.
It utilizes a container that holds mappings between collection types and their respective CollectionTypeFill implementations.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new CollectionElementCreationService and initializes the container by searching for local container implementations and adding default mappings. -
Method Summary
Modifier and TypeMethodDescriptiongenerateCollection(Field field, Fill fill) Generates a collection based on the provided field and Fill object.static Class<?>getTypeClass(Field field, Fill fill) Retrieves the class of the field's type, taking into account generic types defined in Fill object.
-
Constructor Details
-
CollectionElementCreationService
public CollectionElementCreationService()Constructs a new CollectionElementCreationService and initializes the container by searching for local container implementations and adding default mappings.
-
-
Method Details
-
generateCollection
Generates a collection based on the provided field and Fill object. Determines the element type of the collection, retrieves the appropriate CollectionTypeFill implementation, and delegates the generation to that implementation.- Parameters:
field- The field for which the collection is being generated.fill- The Fill object containing the necessary information for generation.- Returns:
- The generated collection.
-
getTypeClass
Retrieves the class of the field's type, taking into account generic types defined in Fill object.- Parameters:
field- The field for which the type class is being retrieved.fill- The Fill object containing the generic type information.- Returns:
- The class representing the field's type.
-