All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.eurodyn.qlack.fuse.cm.mapper.BinChunkDTOMapper Maven / Gradle / Ivy

There is a newer version: 3.6.8
Show newest version
package com.eurodyn.qlack.fuse.cm.mapper;

import com.eurodyn.qlack.fuse.cm.dto.BinChunkDTO;
import com.eurodyn.qlack.fuse.cm.model.Version;
import com.eurodyn.qlack.fuse.cm.model.VersionBin;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Named;
import org.mapstruct.ReportingPolicy;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface BinChunkDTOMapper extends CMBaseMapper {

  @Override
  @Mapping(target = "versionID", source = "version", qualifiedByName = "mapVersion")
  BinChunkDTO mapToDTO(VersionBin versionBin);

  /**
   * Maps the Version value
   *
   * @param version the Version of the bin
   * @return the id of the Version
   */
  @Named("mapVersion")
  default String mapVersion(Version version) {
    if (version == null) {
      return null;
    }
    String id = version.getId();
    if (id == null) {
      return null;
    }
    return id;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy