com.lwohvye.tools.service.mapstruct.LocalStorageMapperImpl Maven / Gradle / Ivy
package com.lwohvye.tools.service.mapstruct;
import com.lwohvye.context.CycleAvoidingMappingContext;
import com.lwohvye.tools.domain.LocalStorage;
import com.lwohvye.tools.service.dto.LocalStorageDto;
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 = "2022-02-02T22:31:14+0800",
comments = "version: 1.4.2.Final, compiler: javac, environment: Java 17 (Oracle Corporation)"
)
@Component
public class LocalStorageMapperImpl implements LocalStorageMapper {
@Override
public LocalStorage toEntity(LocalStorageDto dto, CycleAvoidingMappingContext context) {
LocalStorage target = context.getMappedInstance( dto, LocalStorage.class );
if ( target != null ) {
return target;
}
if ( dto == null ) {
return null;
}
LocalStorage localStorage = new LocalStorage();
context.storeMappedInstance( dto, localStorage );
localStorage.setCreateBy( dto.getCreateBy() );
localStorage.setUpdateBy( dto.getUpdateBy() );
localStorage.setCreateTime( dto.getCreateTime() );
localStorage.setUpdateTime( dto.getUpdateTime() );
localStorage.setId( dto.getId() );
localStorage.setRealName( dto.getRealName() );
localStorage.setName( dto.getName() );
localStorage.setSuffix( dto.getSuffix() );
localStorage.setType( dto.getType() );
localStorage.setSize( dto.getSize() );
return localStorage;
}
@Override
public LocalStorageDto toDto(LocalStorage entity, CycleAvoidingMappingContext context) {
LocalStorageDto target = context.getMappedInstance( entity, LocalStorageDto.class );
if ( target != null ) {
return target;
}
if ( entity == null ) {
return null;
}
LocalStorageDto localStorageDto = new LocalStorageDto();
context.storeMappedInstance( entity, localStorageDto );
localStorageDto.setCreateBy( entity.getCreateBy() );
localStorageDto.setUpdateBy( entity.getUpdateBy() );
localStorageDto.setCreateTime( entity.getCreateTime() );
localStorageDto.setUpdateTime( entity.getUpdateTime() );
localStorageDto.setId( entity.getId() );
localStorageDto.setRealName( entity.getRealName() );
localStorageDto.setName( entity.getName() );
localStorageDto.setSuffix( entity.getSuffix() );
localStorageDto.setType( entity.getType() );
localStorageDto.setSize( entity.getSize() );
return localStorageDto;
}
@Override
public List toEntity(List dtoList, CycleAvoidingMappingContext context) {
List target = context.getMappedInstance( dtoList, List.class );
if ( target != null ) {
return target;
}
if ( dtoList == null ) {
return null;
}
List list = new ArrayList( dtoList.size() );
context.storeMappedInstance( dtoList, list );
for ( LocalStorageDto localStorageDto : dtoList ) {
list.add( toEntity( localStorageDto, context ) );
}
return list;
}
@Override
public List toDto(List entityList, CycleAvoidingMappingContext context) {
List target = context.getMappedInstance( entityList, List.class );
if ( target != null ) {
return target;
}
if ( entityList == null ) {
return null;
}
List list = new ArrayList( entityList.size() );
context.storeMappedInstance( entityList, list );
for ( LocalStorage localStorage : entityList ) {
list.add( toDto( localStorage, context ) );
}
return list;
}
}