package com.github.swissquote.carnotzet.core;

import java.util.Map;
import java.util.Set;

import org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenCoordinate;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Value;

@Value
@AllArgsConstructor
@Builder(toBuilder = true)
/**
 * Represents and application with it's configuration inside a Carnotzet environment
 */
public class CarnotzetModule {

	private final MavenCoordinate id;
	private final String name;
	private final String topLevelModuleName;
	private final Map<String, String> properties;
	private final String imageName;
	private final Set<String> dockerVolumes;
	private final String dockerEntrypoint;
	private final Set<String> dockerEnvFiles;

	public Boolean isDataModule() {
		return "true".equals(properties.get("data"));
	}

	public String getDataModuleType() {
		return properties.get("data.type");
	}

	public String getContainerName() {
		return topLevelModuleName + "_" + name;
	}

	public String getShortImageName() {
		String withoutHost = imageName.replaceFirst(".*/", "");
		return withoutHost.replaceFirst(":.*", "");
	}
}

@@ -734,254 +734,8 @@
 s;%0A%0A
-%09public Boolean isDataModule() %7B%0A%09%09return %22true%22.equals(properties.get(%22data%22));%0A%09%7D%0A%0A%09public String getDataModuleType() %7B%0A%09%09return properties.get(%22data.type%22);%0A%09%7D%0A%0A%09public String getContainerName() %7B%0A%09%09return topLevelModuleName + %22_%22 + name;%0A%09%7D%0A%0A
 %09pub

Remove methods in CarnotzetModule