com.eurodyn.qlack.fuse.aaa.mappers.OperationMapperImpl Maven / Gradle / Ivy
package com.eurodyn.qlack.fuse.aaa.mappers;
import com.eurodyn.qlack.fuse.aaa.dto.OperationDTO;
import com.eurodyn.qlack.fuse.aaa.model.Operation;
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 OperationMapperImpl implements OperationMapper {
@Override
public OperationDTO mapToDTO(Operation entity) {
if ( entity == null ) {
return null;
}
OperationDTO operationDTO = new OperationDTO();
operationDTO.setId( entity.getId() );
operationDTO.setName( entity.getName() );
operationDTO.setDynamic( entity.isDynamic() );
operationDTO.setDynamicCode( entity.getDynamicCode() );
operationDTO.setDescription( entity.getDescription() );
return operationDTO;
}
@Override
public List mapToDTO(List entity) {
if ( entity == null ) {
return null;
}
List list = new ArrayList( entity.size() );
for ( Operation operation : entity ) {
list.add( mapToDTO( operation ) );
}
return list;
}
@Override
public Operation mapToEntity(OperationDTO dto) {
if ( dto == null ) {
return null;
}
Operation operation = new Operation();
operation.setId( dto.getId() );
operation.setName( dto.getName() );
operation.setDescription( dto.getDescription() );
operation.setDynamic( dto.isDynamic() );
operation.setDynamicCode( dto.getDynamicCode() );
return operation;
}
@Override
public void mapToExistingEntity(OperationDTO dto, Operation entity) {
if ( dto == null ) {
return;
}
entity.setId( dto.getId() );
entity.setName( dto.getName() );
entity.setDescription( dto.getDescription() );
entity.setDynamic( dto.isDynamic() );
entity.setDynamicCode( dto.getDynamicCode() );
}
@Override
public List mapToEntity(List dto) {
if ( dto == null ) {
return null;
}
List list = new ArrayList( dto.size() );
for ( OperationDTO operationDTO : dto ) {
list.add( mapToEntity( operationDTO ) );
}
return list;
}
}