SudokuFX
Loading...
Searching...
No Matches
fr.softsf.sudokufx.service.business.GridService Class Reference

Service for managing Grid entities. More...

Collaboration diagram for fr.softsf.sudokufx.service.business.GridService:

Public Member Functions

 GridService (GridRepository gridRepository, IGridMapper gridMapper, JakartaValidator jakartaValidator)
 Constructs a new GridService with the required database and mapping dependencies.
GridDto duplicateGrid (Long gridId)
 Duplicates an existing Grid entity by creating a new record with a generated ID using the fluent builder.

Private Attributes

final IGridMapper gridMapper
final GridRepository gridRepository
final JakartaValidator jakartaValidator

Detailed Description

Service for managing Grid entities.

Provides duplication operations on grids, mapping entities to GridDto and validating DTOs with JakartaValidator after persistence.

Methods:

Throws NullPointerException for null IDs, IllegalArgumentException if the entity is missing, and jakarta.validation.ConstraintViolationException on validation failures.

Constructor & Destructor Documentation

◆ GridService()

fr.softsf.sudokufx.service.business.GridService.GridService ( GridRepository gridRepository,
IGridMapper gridMapper,
JakartaValidator jakartaValidator )

Constructs a new GridService with the required database and mapping dependencies.

Parameters
gridRepositorythe repository used to access and persist Grid entities
gridMapperthe mapper used to convert Grid entities to GridDto
jakartaValidatorthe validator used to ensure data integrity of processed DTOs

Member Function Documentation

◆ duplicateGrid()

GridDto fr.softsf.sudokufx.service.business.GridService.duplicateGrid ( Long gridId)

Duplicates an existing Grid entity by creating a new record with a generated ID using the fluent builder.

Fetches the source entity, copies its properties to a new instance via the builder API, persists it, and validates the resulting DTO before returning.

Parameters
gridIdthe ID of the Grid entity to duplicate; must not be null
Returns
the newly created and validated GridDto
Exceptions
NullPointerExceptionif gridId is null
IllegalArgumentExceptionif the source Grid entity does not exist
jakarta.validation.ConstraintViolationExceptionif validation fails on the resulting DTO
Here is the call graph for this function:

Member Data Documentation

◆ gridMapper

final IGridMapper fr.softsf.sudokufx.service.business.GridService.gridMapper
private

◆ gridRepository

final GridRepository fr.softsf.sudokufx.service.business.GridService.gridRepository
private

◆ jakartaValidator

final JakartaValidator fr.softsf.sudokufx.service.business.GridService.jakartaValidator
private

The documentation for this class was generated from the following file: