package com.eactive.eai.rms.onl.manage.comm.server;

import org.mapstruct.BeanMapping;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;

import com.eactive.eai.data.entity.onl.server.EAIServer;
import com.eactive.eai.data.mapper.BaseMapperConfig;
import com.eactive.eai.data.mapper.GenericMapper;

@Mapper(config = BaseMapperConfig.class)
public interface EAIServerUIMapper extends GenericMapper<EAIServerUI, EAIServer> {

	@Mapping(source = "eaisevrinstncname", target = "eaiSevrInstncName")
	@Mapping(source = "cloudrouterurl", target = "cloudRouterUrl")
	@Mapping(source = "eaisevrip", target = "eaiSevrIp")
	@Mapping(source = "flovrsevrname", target = "flovrSevrName")
	@Mapping(source = "hostname", target = "hostName")
	@Mapping(source = "sevrlsnportname", target = "sevrLsnPortName")
	@Override
	EAIServerUI toVo(EAIServer entity);

	@InheritInverseConfiguration
	@Override
	EAIServer toEntity(EAIServerUI vo);

	@InheritConfiguration
	@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
	void updateEntity(EAIServerUI eaiServerUI, @MappingTarget EAIServer eaiServer);

}
