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

Service for managing Options entities. More...

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

Public Member Functions

 OptionsService (OptionsRepository optionsRepository, IOptionsMapper optionsMapper, JakartaValidator jakartaValidator)
 Constructs a new OptionsService with the required database, mapping, and validation dependencies.
OptionsDto duplicateOptions (Long optionsId)
 Duplicates an existing Options entity by creating a new record with a generated ID using the fluent builder.
OptionsDto updateOptions (OptionsDto dto)
 Updates an existing Options entity with the values from the given OptionsDto.

Private Attributes

final JakartaValidator jakartaValidator
final IOptionsMapper optionsMapper
final OptionsRepository optionsRepository

Detailed Description

Service for managing Options entities.

Provides retrieval and update operations on options, mapping entities to OptionsDto and validating DTOs with JakartaValidator before and after persistence.

Methods:

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

Constructor & Destructor Documentation

◆ OptionsService()

fr.softsf.sudokufx.service.business.OptionsService.OptionsService ( OptionsRepository optionsRepository,
IOptionsMapper optionsMapper,
JakartaValidator jakartaValidator )

Constructs a new OptionsService with the required database, mapping, and validation dependencies.

Parameters
optionsRepositorythe repository used to access and persist Options entities
optionsMapperthe mapper used to convert Options entities to OptionsDto
jakartaValidatorthe validator used to ensure data integrity of processed DTOs

Member Function Documentation

◆ duplicateOptions()

OptionsDto fr.softsf.sudokufx.service.business.OptionsService.duplicateOptions ( Long optionsId)

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

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

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

◆ updateOptions()

OptionsDto fr.softsf.sudokufx.service.business.OptionsService.updateOptions ( OptionsDto dto)

Updates an existing Options entity with the values from the given OptionsDto.

Validates the DTO before applying changes and validates the resulting DTO after saving.

Parameters
dtothe options data to update; must not be null
Returns
the updated and validated OptionsDto
Exceptions
NullPointerExceptionif dto is null
IllegalArgumentExceptionif the Options entity does not exist
jakarta.validation.ConstraintViolationExceptionif validation fails on the DTO
Here is the call graph for this function:

Member Data Documentation

◆ jakartaValidator

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

◆ optionsMapper

final IOptionsMapper fr.softsf.sudokufx.service.business.OptionsService.optionsMapper
private

◆ optionsRepository

final OptionsRepository fr.softsf.sudokufx.service.business.OptionsService.optionsRepository
private

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