All Implemented Interfaces:
BusinessDomainMapper<SampleQuery,SampleQueryDTO>

public class SampleQueryMapper extends AbstractBusinessDomainMapper<SampleQuery,SampleQueryDTO>
Bidirectional mapper between SampleQuery and SampleQueryDTO.

Maintains caches in both directions and refreshes entries when the source side has a newer version. Allocates IDs via an injected supplier for new DTOs.

Singleton — access via getInstance().

Since:
1.0
Author:
Felix Seggebäing
  • Method Details

    • getInstance

      public static SampleQueryMapper getInstance()
    • get

      public SampleQuery get(SampleQueryDTO dto)
      Maps a SampleQueryDTO to its SampleQuery counterpart with caching.

      Returns the cached BDO if present and up to date; otherwise creates a new SampleQuery from the DTO fields (converting complexity string to SampleQuery.Complexity when non-null), updates the bidirectional cache, and returns it.

      Parameters:
      dto - the source DTO; may be null
      Returns:
      the mapped SampleQuery, or null if dto is null
      Implementation Note:
      The cache is refreshed when the DTO's version is newer than the cached BDO's version.
    • get

      public SampleQueryDTO get(SampleQuery bdo)
      Maps a SampleQuery business object to its SampleQueryDTO with caching.

      Returns the cached DTO if present and up to date; otherwise creates a new DTO, reusing the existing ID if cached or allocating one via idSupplier if not. The cache is refreshed when the BDO's version is newer than the cached DTO's.

      Parameters:
      bdo - the source business object; may be null
      Returns:
      the mapped SampleQueryDTO, or null if bdo is null