Class IndividualResultMapper
java.lang.Object
com.endurancetrio.business.event.mapper.IndividualResultMapper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmap(RaceDTO race, IndividualResult entity, Integer rank, Duration winnerTotal) Maps anIndividualResultentity to anIndividualResultDTO.
-
Constructor Details
-
IndividualResultMapper
-
-
Method Details
-
map
public IndividualResultDTO map(RaceDTO race, IndividualResult entity, Integer rank, Duration winnerTotal) Maps anIndividualResultentity to anIndividualResultDTO.If the entity has a
source result(indicating an inherited competition entry), the data is taken from that source - the original result from the feeder race — while the given entity's ownrankis preserved for the current race's classification.The time
gaprelative to the overall winner is computed viagetGap(com.endurancetrio.data.event.model.entity.IndividualResult, java.time.Duration).- Parameters:
race- the race context to attach to the result DTOentity- the individual result entity to map; may be null. Itsidis always used as the DTO's id, regardless of the source-result chainrank- the rank assigned in the current race (may be overridden if the entity already has a rank)winnerTotal- the overall winner's total duration, used for gap computation- Returns:
- the mapped
IndividualResultDTO, ornullifentityis null
-