package com.progetto.VEBS.mapper;

import org.springframework.stereotype.Component;

import com.progetto.VEBS.model.dto.AreaBluDTO;
import com.progetto.VEBS.model.entity.AreaBlu;

@Component
public class AreaBluMapperImpl implements AreaBluMapper {

	@Override
	public AreaBluDTO toDTO(AreaBlu entity) {
		if ( entity == null ) {
            return null;
        }
        AreaBluDTO areaBluDTO = new AreaBluDTO();
        areaBluDTO.setId(entity.getId());
        areaBluDTO.setNome(entity.getNome());
        areaBluDTO.setGeometry(entity.getGeometry());
        return areaBluDTO;
	}

	@Override
	public AreaBlu toEntity(AreaBluDTO dto) {
		if ( dto == null ) {
            return null;
        }
		AreaBlu areaBlu = new AreaBlu();
		areaBlu.setId(dto.getId());
		areaBlu.setNome(dto.getNome());
		areaBlu.setGeometry(dto.getGeometry());
        return areaBlu;
	}
	
	
}