All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.dekorate.jib.adapter.JibBuildConfigAdapter Maven / Gradle / Ivy

There is a newer version: 4.1.4
Show newest version
package io.dekorate.jib.adapter;

import java.nio.file.Path;
import io.dekorate.project.Project;
import io.dekorate.jib.annotation.JibBuild;
import io.dekorate.jib.config.JibBuildConfigBuilder;
import io.dekorate.project.BuildInfo;
import io.dekorate.jib.config.JibBuildConfig;
import java.lang.String;
import io.dekorate.project.ScmInfo;
import java.util.Map;
import java.util.Comparator;

public class JibBuildConfigAdapter{



    public static JibBuildConfig adapt(JibBuild instance){
            return newBuilder(instance).build();
    }

    public static JibBuildConfigBuilder newBuilder(JibBuild instance){
            return new JibBuildConfigBuilder(new io.dekorate.jib.config.JibBuildConfig(null,
            null,
            instance.registry(),
            instance.group(),
            instance.name(),
            instance.version(),
            instance.image(),
            null,
            instance.autoBuildEnabled(),
            instance.autoPushEnabled(),
            instance.enabled(),
            instance.dockerBuild(),
            instance.from(),
            instance.autoDeployEnabled()));
    }

    public static JibBuildConfig adapt(Map map){
            return new io.dekorate.jib.config.JibBuildConfig(
null,
null,
               (String)(map instanceof Map ? ((Map)map).getOrDefault("registry", "") : ""),
               (String)(map instanceof Map ? ((Map)map).getOrDefault("group", "") : ""),
               (String)(map instanceof Map ? ((Map)map).getOrDefault("name", "") : ""),
               (String)(map instanceof Map ? ((Map)map).getOrDefault("version", "") : ""),
               (String)(map instanceof Map ? ((Map)map).getOrDefault("image", "") : ""),
null,
               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("enabled","true") : "true")),
               Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("dockerBuild","true") : "true")),
               (String)(map instanceof Map ? ((Map)map).getOrDefault("from", "openjdk:8-jdk") : "openjdk:8-jdk"),
               Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("autoDeployEnabled","false") : "false")));
    }

    public static JibBuildConfigBuilder newBuilder(Map map){
            return new JibBuildConfigBuilder(new io.dekorate.jib.config.JibBuildConfig(
null,
null,
               (String)(map instanceof Map ? ((Map)map).getOrDefault("registry", "") : ""),
               (String)(map instanceof Map ? ((Map)map).getOrDefault("group", "") : ""),
               (String)(map instanceof Map ? ((Map)map).getOrDefault("name", "") : ""),
               (String)(map instanceof Map ? ((Map)map).getOrDefault("version", "") : ""),
               (String)(map instanceof Map ? ((Map)map).getOrDefault("image", "") : ""),
null,
               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("enabled","true") : "true")),
               Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("dockerBuild","true") : "true")),
               (String)(map instanceof Map ? ((Map)map).getOrDefault("from", "openjdk:8-jdk") : "openjdk:8-jdk"),
               Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("autoDeployEnabled","false") : "false"))));
    }




}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy