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

Service class providing business logic related to Player entities. More...

+ Collaboration diagram for fr.softsf.sudokufx.service.business.PlayerService:

Public Member Functions

 PlayerService (PlayerRepository playerRepository, IPlayerMapper playerMapper, JakartaValidator jakartaValidator)
 
PlayerDto getPlayer ()
 Retrieves and validates the first player with a selected game.
 

Private Attributes

final JakartaValidator jakartaValidator
 
final IPlayerMapper playerMapper
 
final PlayerRepository playerRepository
 

Detailed Description

Service class providing business logic related to Player entities.

It interacts with the PlayerRepository to retrieve Player data, uses IPlayerMapper to convert entities to PlayerDto objects, and performs Jakarta Bean Validation on results.

All method parameters and return values in this package are non-null by default, thanks to the @NonNullApi annotation at the package level.

Constructor & Destructor Documentation

◆ PlayerService()

fr.softsf.sudokufx.service.business.PlayerService.PlayerService ( PlayerRepository playerRepository,
IPlayerMapper playerMapper,
JakartaValidator jakartaValidator )

Member Function Documentation

◆ getPlayer()

PlayerDto fr.softsf.sudokufx.service.business.PlayerService.getPlayer ( )

Retrieves and validates the first player with a selected game.

The player must have a non-null selected game and pass all Jakarta Bean Validation constraints.

Returns
a validated PlayerDto
Exceptions
IllegalArgumentExceptionif no matching player is found
ConstraintViolationExceptionif validation fails on the mapped PlayerDto
+ Here is the call graph for this function:

Member Data Documentation

◆ jakartaValidator

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

◆ playerMapper

final IPlayerMapper fr.softsf.sudokufx.service.business.PlayerService.playerMapper
private

◆ playerRepository

final PlayerRepository fr.softsf.sudokufx.service.business.PlayerService.playerRepository
private

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