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

com.eurodyn.qlack.fuse.aaa.mapper.ResourceMapperImpl Maven / Gradle / Ivy

The newest version!
package com.eurodyn.qlack.fuse.aaa.mapper;

import com.eurodyn.qlack.fuse.aaa.dto.ResourceDTO;
import com.eurodyn.qlack.fuse.aaa.model.Resource;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.processing.Generated;
import org.springframework.stereotype.Component;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-09-20T10:45:53+0000",
    comments = "version: 1.5.5.Final, compiler: javac, environment: Java 17.0.2 (Private Build)"
)
@Component
public class ResourceMapperImpl implements ResourceMapper {

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

        ResourceDTO resourceDTO = new ResourceDTO();

        resourceDTO.setId( entity.getId() );
        resourceDTO.setName( entity.getName() );
        resourceDTO.setDescription( entity.getDescription() );
        resourceDTO.setObjectId( entity.getObjectId() );

        return resourceDTO;
    }

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

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

        return list;
    }

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

        Resource resource = new Resource();

        resource.setId( dto.getId() );
        resource.setName( dto.getName() );
        resource.setDescription( dto.getDescription() );
        resource.setObjectId( dto.getObjectId() );

        return resource;
    }

    @Override
    public void mapToExistingEntity(ResourceDTO dto, Resource entity) {
        if ( dto == null ) {
            return;
        }

        entity.setId( dto.getId() );
        entity.setName( dto.getName() );
        entity.setDescription( dto.getDescription() );
        entity.setObjectId( dto.getObjectId() );
    }

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

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

        return list;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy