package jp.ac.nii.prl.mape.autoscaling.analysis.model.dto;

import jp.ac.nii.prl.mape.autoscaling.analysis.model.Adaptation;
import jp.ac.nii.prl.mape.autoscaling.analysis.model.Deployment;
import jp.ac.nii.prl.mape.autoscaling.analysis.model.Instance;
import jp.ac.nii.prl.mape.autoscaling.analysis.model.InstanceType;

public class DeploymentFactory {

	public static Deployment createDeployment(DeploymentDTO dto) {
		return null;
	}
	
	public static DeploymentDTO createDeploymentDTO(Deployment deployment) {
		return null;
	}
	
	public static Adaptation createAdaptation(AdaptationDTO dto, Deployment deployment) {
		Adaptation adaptation = new Adaptation();
		
		adaptation.setAdapt(dto.isAdapt());
		adaptation.setCpuCount(dto.getCpuCount());
		adaptation.setScaleUp(dto.isScaleUp());
		adaptation.setDeployment(deployment);
		
		return adaptation;
	}
	
	public static AdaptationDTO createAdaptationDTO(Adaptation adaptation) {
		AdaptationDTO dto = new AdaptationDTO();
		
		dto.setAdapt(adaptation.isAdapt());
		dto.setCpuCount(adaptation.getCpuCount());
		dto.setScaleUp(adaptation.isScaleUp());
		
		return dto;
	}
	
	public static Instance createInstance(InstanceDTO dto) {
		return null;
	}
	
	public static InstanceDTO createInstanceDTO(Instance instance) {
		return null;
	}
	
	public static InstanceType createInstanceType(InstanceTypeDTO dto) {
		return null;
	}
	
	public static InstanceTypeDTO createInstanceTypeDTO(InstanceType instanceType) {
		return null;
	}

}

@@ -1179,97 +1179,580 @@
  dto
-) %7B%0A%09%09return null;%0A%09%7D%0A%09%0A%09public static InstanceDTO createInstanceDTO(Instance instance) %7B
+, %0A%09%09%09Deployment deployment, %0A%09%09%09InstanceType instanceType) %7B%0A%09%09Instance instance = new Instance();%0A%09%09%0A%09%09instance.setDeployment(deployment);%0A%09%09instance.setInstanceType(instanceType);%0A%09%09instance.setInstID(dto.getInstID());%0A%09%09instance.setInstLoad(dto.getInstLoad());%0A%09%09instance.setInstType(dto.getInstType());%0A%09%09%09%09%0A%09%09return instance;%0A%09%7D%0A%09%0A%09public static InstanceDTO createInstanceDTO(Instance instance) %7B%0A%09%09InstanceDTO dto = new InstanceDTO();%0A%09%09%0A%09%09dto.setInstID(instance.getInstID());%0A%09%09dto.setInstLoad(instance.getInstLoad());%0A%09%09dto.setInstType(instance.getInstType());%0A%09%09
 %0A%09%09r
@@ -1749,36 +1749,35 @@
 ));%0A%09%09%0A%09%09return 
-null
+dto
 ;%0A%09%7D%0A%09%0A%09public s

Implement Instance to InstanceDTO and back