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

com.eurodyn.qlack.fuse.cm.mapper.BinChunkDTOMapperImpl 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.VersionBin;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.annotation.processing.Generated;
import org.springframework.stereotype.Component;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-07-23T12:39:03+0000",
    comments = "version: 1.5.5.Final, compiler: javac, environment: Java 17.0.2 (Private Build)"
)
@Component
public class BinChunkDTOMapperImpl implements BinChunkDTOMapper {

    @Override
    public List mapToDTO(List entity) {
        if ( entity == null ) {
            return null;
        }

        List list = new ArrayList( entity.size() );
        for ( VersionBin versionBin : entity ) {
            list.add( mapToDTO( versionBin ) );
        }

        return list;
    }

    @Override
    public VersionBin mapToEntity(BinChunkDTO dto) {
        if ( dto == null ) {
            return null;
        }

        VersionBin versionBin = new VersionBin();

        versionBin.setId( dto.getId() );
        byte[] binContent = dto.getBinContent();
        if ( binContent != null ) {
            versionBin.setBinContent( Arrays.copyOf( binContent, binContent.length ) );
        }
        versionBin.setChunkIndex( dto.getChunkIndex() );

        return versionBin;
    }

    @Override
    public List mapToEntity(List dto) {
        if ( dto == null ) {
            return null;
        }

        List list = new ArrayList( dto.size() );
        for ( BinChunkDTO binChunkDTO : dto ) {
            list.add( mapToEntity( binChunkDTO ) );
        }

        return list;
    }

    @Override
    public BinChunkDTO mapToDTO(VersionBin versionBin) {
        if ( versionBin == null ) {
            return null;
        }

        BinChunkDTO binChunkDTO = new BinChunkDTO();

        binChunkDTO.setVersionID( mapVersion( versionBin.getVersion() ) );
        binChunkDTO.setId( versionBin.getId() );
        byte[] binContent = versionBin.getBinContent();
        if ( binContent != null ) {
            binChunkDTO.setBinContent( Arrays.copyOf( binContent, binContent.length ) );
        }
        binChunkDTO.setChunkIndex( versionBin.getChunkIndex() );

        return binChunkDTO;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy