// Path: yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/utils/BindUtils.java
// @Nonnull
// public static String joinToStr(List<String> joinList) {
//     // with null check
//     if (CollectionUtils.isEmpty(joinList)) {
//         return "";
//     }
// 
//     return Joiner.on("\n").join(joinList);
// }
// 
// Path: yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/utils/BindUtils.java
// @Nonnull
// public static List<String> splitAndFilterEmpty(@Nonnull String s) {
//     return splitAndFilterEmpty(s, "\n");
// }


import com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator;
import com.cloudbees.jenkins.plugins.sshcredentials.SSHUserListBoxModel;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.command.CreateContainerCmd;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.Bind;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.Device;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.HostConfig;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.Link;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.PortBinding;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.Volume;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.VolumesFrom;
import com.github.kostyasha.yad_docker_java.com.google.common.base.Function;
import com.github.kostyasha.yad_docker_java.com.google.common.base.Splitter;
import com.github.kostyasha.yad_docker_java.com.google.common.base.Strings;
import com.github.kostyasha.yad_docker_java.com.google.common.collect.Iterables;
import com.trilead.ssh2.Connection;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import hudson.model.ItemGroup;
import hudson.plugins.sshslaves.SSHLauncher;
import hudson.security.ACL;
import hudson.security.AccessControlled;
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import jenkins.model.Jenkins;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.CheckForNull;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.github.kostyasha.yad.commons.DockerContainerRestartPolicyName.NO;
import static com.github.kostyasha.yad.utils.BindUtils.joinToStr;
import static com.github.kostyasha.yad.utils.BindUtils.splitAndFilterEmpty;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
import static org.apache.commons.lang.StringUtils.trimToNull;
import static org.apache.commons.lang.builder.ToStringStyle.SHORT_PREFIX_STYLE;
    @CheckForNull
    public List<String> getVolumes() {
        return volumes;
    }

    public void setVolumes(List<String> volumes) {
        this.volumes = volumes;
    }

    @Nonnull
    public String getVolumesString() {
        return joinToStr(volumes);
    }

    @DataBoundSetter
    public void setVolumesString(String volumesString) {
        setVolumes(splitAndFilterEmpty(volumesString));
    }

    @CheckForNull
    public List<String> getVolumesFrom() {
        return volumesFrom;
    }

    public void setVolumesFrom(List<String> folumesFrom) {
        this.volumesFrom = folumesFrom;
    }

    @DataBoundSetter
    public void setVolumesFromString(String volumesFromString) {
// Path: yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/utils/BindUtils.java
// @Nonnull
// public static String joinToStr(List<String> joinList) {
//     // with null check
//     if (CollectionUtils.isEmpty(joinList)) {
//         return "";
//     }
// 
//     return Joiner.on("\n").join(joinList);
// }
// 
// Path: yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/utils/BindUtils.java
// @Nonnull
// public static List<String> splitAndFilterEmpty(@Nonnull String s) {
//     return splitAndFilterEmpty(s, "\n");
// }


// Path: yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/commons/DockerCreateContainer.java
import com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator;
import com.cloudbees.jenkins.plugins.sshcredentials.SSHUserListBoxModel;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.command.CreateContainerCmd;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.Bind;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.Device;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.HostConfig;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.Link;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.PortBinding;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.Volume;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.model.VolumesFrom;
import com.github.kostyasha.yad_docker_java.com.google.common.base.Function;
import com.github.kostyasha.yad_docker_java.com.google.common.base.Splitter;
import com.github.kostyasha.yad_docker_java.com.google.common.base.Strings;
import com.github.kostyasha.yad_docker_java.com.google.common.collect.Iterables;
import com.trilead.ssh2.Connection;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import hudson.model.ItemGroup;
import hudson.plugins.sshslaves.SSHLauncher;
import hudson.security.ACL;
import hudson.security.AccessControlled;
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import jenkins.model.Jenkins;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.CheckForNull;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.github.kostyasha.yad.commons.DockerContainerRestartPolicyName.NO;
import static com.github.kostyasha.yad.utils.BindUtils.joinToStr;
import static com.github.kostyasha.yad.utils.BindUtils.splitAndFilterEmpty;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
import static org.apache.commons.lang.StringUtils.trimToNull;
import static org.apache.commons.lang.builder.ToStringStyle.SHORT_PREFIX_STYLE;

    @CheckForNull
    public List<String> getVolumes() {
        return volumes;
    }

    public void setVolumes(List<String> volumes) {
        this.volumes = volumes;
    }

    @Nonnull
    public String getVolumesString() {
        return joinToStr(volumes);
    }

    @DataBoundSetter
    public void setVolumesString(String volumesString) {
        setVolumes(splitAndFilterEmpty(volumesString));
    }

    @CheckForNull
    public List<String> getVolumesFrom() {
        return volumesFrom;
    }

    public void setVolumesFrom(List<String> folumesFrom) {
        this.volumesFrom = folumesFrom;
    }

    @DataBoundSetter
    public void setVolumesFromString(String volumesFromString) {
        setVolumesFrom(splitAndFilterEmpty(volumesFromString));