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

io.dekorate.testing.adapter.KubernetesIntegrationTestConfigAdapter Maven / Gradle / Ivy

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

import io.dekorate.testing.annotation.KubernetesIntegrationTest;
import java.util.stream.Collectors;
import io.dekorate.testing.config.KubernetesIntegrationTestConfig;
import java.lang.Object;
import java.util.List;
import io.dekorate.testing.config.KubernetesIntegrationTestConfigBuilder;
import java.lang.String;
import java.util.Arrays;
import java.util.Map;

/**
 * Generated
 */
public class KubernetesIntegrationTestConfigAdapter{
  
  
  
  public static KubernetesIntegrationTestConfig adapt(KubernetesIntegrationTest instance) {
    return newBuilder(instance).build();
  }
  
  public static KubernetesIntegrationTestConfigBuilder newBuilder(KubernetesIntegrationTest instance) {
    return new KubernetesIntegrationTestConfigBuilder(new KubernetesIntegrationTestConfig(instance.deployEnabled(),
                instance.buildEnabled(),
                instance.readinessTimeout(),
                instance.additionalModules()));
  }
  
  public static KubernetesIntegrationTestConfig adapt(Map map) {
    return new KubernetesIntegrationTestConfig(
                   java.lang.Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("deployEnabled","false") : "false")),
                   java.lang.Boolean.parseBoolean(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("buildEnabled","false") : "false")),
                   java.lang.Long.parseLong(String.valueOf(map instanceof Map ? ((Map)map).getOrDefault("readinessTimeout","0") : "0")),
    map instanceof Map ? toStringArray(((Map)map).get("additionalModules")) : toStringArray(map));
  }
  
  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