package gov.va.med.tfs.mapping.tfstocds;

import gov.va.med.tfs.client.webservice.DomainEntryPoint;
import gov.va.med.tfs.exception.WtfServiceCreateException;
import gov.va.med.tfs.mapping.MapperInterface;

public class DomainEntryPointMapper 
	implements
	MapperInterface<DomainEntryPoint, gov.va.med.cds.clinicaldata.DomainEntryPoint>
{
	private static DomainEntryPointMapper domainEntryPointMapper = new DomainEntryPointMapper();

	private DomainEntryPointMapper( )
	{
	}

	public static DomainEntryPointMapper getInstance( )
	{
		return domainEntryPointMapper;
	}

	@Override
	public gov.va.med.cds.clinicaldata.DomainEntryPoint map(
			DomainEntryPoint fromTfsDomainEntryPoint) throws Exception 
	{
		gov.va.med.cds.clinicaldata.DomainEntryPoint toCdsDomainEntryPoint = null;
		
        String fromTfsName = fromTfsDomainEntryPoint.getName();
        if ( fromTfsName != null )
        {
    		toCdsDomainEntryPoint = gov.va.med.cds.clinicaldata.DomainEntryPoint.valueOf( fromTfsName );
    		
    		String fromTfsDomain = fromTfsDomainEntryPoint.getDomain();
            if ( fromTfsDomain != null )
            {
            	toCdsDomainEntryPoint.setDomain( fromTfsDomain );
            }

        }

		return toCdsDomainEntryPoint;
	}

}
