io.dekorate.docker.adapter.DockerBuildConfigAdapter Maven / Gradle / Ivy
package io.dekorate.docker.adapter;
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.Object;
import java.util.List;
import java.lang.String;
import io.dekorate.docker.annotation.DockerBuild;
import io.dekorate.project.ScmInfo;
import java.lang.Boolean;
import java.util.Map;
/**
* Generated
*/
public class DockerBuildConfigAdapter{
public static DockerBuildConfig adapt(DockerBuild instance) {
return newBuilder(instance).build();
}
public static DockerBuildConfigBuilder newBuilder(DockerBuild instance) {
return new DockerBuildConfigBuilder(new DockerBuildConfig(null,
null,
instance.enabled(),
instance.registry(),
instance.group(),
instance.name(),
instance.version(),
instance.image(),
instance.dockerFile(),
instance.autoBuildEnabled(),
instance.autoPushEnabled(),
null,
instance.autoDeployEnabled()));
}
public static DockerBuildConfig adapt(Map map) {
return new DockerBuildConfig(
null,
null,
(Boolean)(map instanceof Map ? ((Map)map).getOrDefault("enabled", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("registry", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("group", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("name", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("version", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("image", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("dockerFile", null) : null),
(Boolean)(map instanceof Map ? ((Map)map).getOrDefault("autoBuildEnabled", null) : null),
(Boolean)(map instanceof Map ? ((Map)map).getOrDefault("autoPushEnabled", null) : null),
null,
(Boolean)(map instanceof Map ? ((Map)map).getOrDefault("autoDeployEnabled", null) : null));
}
public static DockerBuildConfigBuilder newBuilder(Map map) {
return new DockerBuildConfigBuilder(new DockerBuildConfig(
null,
null,
(Boolean)(map instanceof Map ? ((Map)map).getOrDefault("enabled", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("registry", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("group", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("name", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("version", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("image", null) : null),
(String)(map instanceof Map ? ((Map)map).getOrDefault("dockerFile", null) : null),
(Boolean)(map instanceof Map ? ((Map)map).getOrDefault("autoBuildEnabled", null) : null),
(Boolean)(map instanceof Map ? ((Map)map).getOrDefault("autoPushEnabled", null) : null),
null,
(Boolean)(map instanceof Map ? ((Map)map).getOrDefault("autoDeployEnabled", null) : null)));
}
public static String[] toStringArray(Object o) {
if (o instanceof String[]) {
return (String[]) o;
}
if (o instanceof String) {
String s = (String) o;
return s.split(",[ ]*");
}
else if (o instanceof List) {
List c = (List) o;
String[] result = new String[c.size()];
for (int i=0; i <= c.size(); i++) {
result[i] = String.valueOf(c.get(i));
}
return result;
}
return new String[0];
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy