io.dekorate.docker.adapter.DockerBuildConfigAdapter Maven / Gradle / Ivy
package io.dekorate.docker.adapter;
import java.nio.file.Path;
import io.dekorate.project.Project;
import io.dekorate.docker.config.DockerBuildConfig;
import io.dekorate.project.BuildInfo;
import io.dekorate.docker.config.DockerBuildConfigBuilder;
import java.lang.String;
import io.dekorate.docker.annotation.DockerBuild;
import io.dekorate.project.ScmInfo;
import java.util.Map;
import java.util.Comparator;
public class DockerBuildConfigAdapter{
public static DockerBuildConfig adapt(DockerBuild instance){
return newBuilder(instance).build();
}
public static DockerBuildConfigBuilder newBuilder(DockerBuild instance){
return new DockerBuildConfigBuilder(new io.dekorate.docker.config.DockerBuildConfig(null,
null,
null,
null,
null,
instance.registry(),
instance.dockerFile(),
instance.autoBuildEnabled(),
instance.autoPushEnabled(),
instance.autoDeployEnabled()));
}
public static DockerBuildConfig adapt(Map map){
return new io.dekorate.docker.config.DockerBuildConfig(
null,
null,
null,
null,
null,
(String)(map instanceof Map ? ((Map)map).getOrDefault("registry", "") : ""),
(String)(map instanceof Map ? ((Map)map).getOrDefault("dockerFile", "Dockerfile") : "Dockerfile"),
Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("autoBuildEnabled","false") : "false")),
Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("autoPushEnabled","false") : "false")),
Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("autoDeployEnabled","false") : "false")));
}
public static DockerBuildConfigBuilder newBuilder(Map map){
return new DockerBuildConfigBuilder(new io.dekorate.docker.config.DockerBuildConfig(
null,
null,
null,
null,
null,
(String)(map instanceof Map ? ((Map)map).getOrDefault("registry", "") : ""),
(String)(map instanceof Map ? ((Map)map).getOrDefault("dockerFile", "Dockerfile") : "Dockerfile"),
Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("autoBuildEnabled","false") : "false")),
Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("autoPushEnabled","false") : "false")),
Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("autoDeployEnabled","false") : "false"))));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy