@Override
	protected ModuleMetadataResource instantiateResource(ModuleMetadata entity) {
		String moduleType = (entity.getModuleType() != null) ? entity.getModuleType().name() : null;
		RESTDeploymentState deploymentStatus = (entity.getDeploymentStatus() != null) ? RESTDeploymentState.valueOf(entity.getDeploymentStatus().name())
				: null;
		return new ModuleMetadataResource(entity.getQualifiedId(), entity.getName(), entity.getUnitName(),
				RESTModuleType.valueOf(moduleType), entity.getContainerId(), entity.getModuleOptions(),
				entity.getDeploymentProperties(), deploymentStatus);
	}
Knows how to assemble {@link ModuleMetadataResource}s out of {@link ModuleMetadata}s.

@author Ilayaperumal Gopinathan
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/rest/ModuleMetadataResourceAssembler.java