com.eurodyn.qlack.fuse.aaa.mappers.ResourceMapperImpl Maven / Gradle / Ivy
package com.eurodyn.qlack.fuse.aaa.mappers;
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.Generated;
import org.springframework.stereotype.Component;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-03T08:55:23+0000",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_161 (Oracle Corporation)"
)
@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;
}
}