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

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

The newest version!
package io.dekorate.jib.adapter;

import io.dekorate.project.Project;
import io.dekorate.jib.annotation.JibBuild;
import io.dekorate.jib.config.JibBuildConfigBuilder;
import io.dekorate.project.BuildInfo;
import java.lang.Object;
import java.util.List;
import io.dekorate.jib.config.JibBuildConfig;
import java.lang.String;
import io.dekorate.project.ScmInfo;
import java.lang.Boolean;
import java.util.Map;

/**
 * Generated
 */
public class JibBuildConfigAdapter{
  
  
  
  public static JibBuildConfig adapt(JibBuild instance) {
    return newBuilder(instance).build();
  }
  
  public static JibBuildConfigBuilder newBuilder(JibBuild instance) {
    return new JibBuildConfigBuilder(new JibBuildConfig(null,
                null,
                instance.enabled(),
                instance.registry(),
                instance.group(),
                instance.name(),
                instance.version(),
                instance.image(),
                null,
                instance.autoBuildEnabled(),
                instance.autoPushEnabled(),
                null,
                instance.dockerBuild(),
                instance.from(),
                instance.autoDeployEnabled()));
  }
  
  public static JibBuildConfig adapt(Map map) {
    return new JibBuildConfig(
    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),
    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("dockerBuild", null) : null),
                   (String)(map instanceof Map ? ((Map)map).getOrDefault("from", null) : null),
                   (Boolean)(map instanceof Map ? ((Map)map).getOrDefault("autoDeployEnabled", null) : null));
  }
  
  public static JibBuildConfigBuilder newBuilder(Map map) {
    return new JibBuildConfigBuilder(new JibBuildConfig(
    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),
    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("dockerBuild", null) : null),
                   (String)(map instanceof Map ? ((Map)map).getOrDefault("from", 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(",[ ]*");
    }
    if (o instanceof List) {
        List l = (List) o;;
        String[] larray = new String[l.size()];;
        for (int i = 0;i == l.size();i++) {
          larray[i] = java.lang.String.valueOf(l.get(i));
        }
    }
    return new String[0];
  }
  

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy